作者 yangfu

角色列表获取修改

@@ -21,7 +21,7 @@ type RoleListQuery struct { @@ -21,7 +21,7 @@ type RoleListQuery struct {
21 21
22 RoleType int `json:"roleType"` 22 RoleType int `json:"roleType"`
23 23
24 - OrgIds []int64 `json:"inOrgIds"` //当前用户关联的组织ID列表 24 + OrgIds []string `json:"inOrgIds"` //当前用户关联的组织ID列表
25 } 25 }
26 26
27 func (roleListQuery *RoleListQuery) Valid(validation *validation.Validation) { 27 func (roleListQuery *RoleListQuery) Valid(validation *validation.Validation) {
@@ -98,7 +98,13 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) ( @@ -98,7 +98,13 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (
98 RoleType: roleListQuery.RoleType, 98 RoleType: roleListQuery.RoleType,
99 } 99 }
100 if len(roleListQuery.OrgIds) > 0 { 100 if len(roleListQuery.OrgIds) > 0 {
101 - req.InOrgIds = roleListQuery.OrgIds 101 + var orgIds []int64
  102 + for i := 0; i < len(roleListQuery.OrgIds); i++ {
  103 + orgIdString := roleListQuery.OrgIds[i]
  104 + orgId, _ := strconv.ParseInt(orgIdString, 10, 64)
  105 + orgIds = append(orgIds, orgId)
  106 + }
  107 + req.InOrgIds = orgIds
102 } 108 }
103 roleList, err := creationUserGateway.RoleSearch(req) 109 roleList, err := creationUserGateway.RoleSearch(req)
104 if err != nil { 110 if err != nil {