|
@@ -66,6 +66,30 @@ func (s *SystemUser) GetPastureIds() []int64 {
|
|
|
return res
|
|
|
}
|
|
|
|
|
|
+func (s *SystemUser) GetRoleIds() []int64 {
|
|
|
+ res := make([]int64, 0)
|
|
|
+ if s.RoleIds != "" {
|
|
|
+ roleIds := strings.Split(s.RoleIds, ",")
|
|
|
+ for _, idStr := range roleIds {
|
|
|
+ id, _ := strconv.Atoi(idStr)
|
|
|
+ res = append(res, int64(id))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res
|
|
|
+}
|
|
|
+
|
|
|
+func (s *SystemUser) GetDepthIds() []int64 {
|
|
|
+ res := make([]int64, 0)
|
|
|
+ if s.DeptIds != "" {
|
|
|
+ depthIds := strings.Split(s.DeptIds, ",")
|
|
|
+ for _, idStr := range depthIds {
|
|
|
+ id, _ := strconv.Atoi(idStr)
|
|
|
+ res = append(res, int64(id))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res
|
|
|
+}
|
|
|
+
|
|
|
type UserModel struct {
|
|
|
SystemUser *SystemUser
|
|
|
AppPasture *AppPastureList
|