作者 tangxuhui
... ... @@ -21,7 +21,7 @@ type RoleListQuery struct {
RoleType int `json:"roleType"`
OrgIds []int64 `json:"inOrgIds"` //当前用户关联的组织ID列表
OrgIds []string `json:"inOrgIds"` //当前用户关联的组织ID列表
}
func (roleListQuery *RoleListQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -98,7 +98,13 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (
RoleType: roleListQuery.RoleType,
}
if len(roleListQuery.OrgIds) > 0 {
req.InOrgIds = roleListQuery.OrgIds
var orgIds []int64
for i := 0; i < len(roleListQuery.OrgIds); i++ {
orgIdString := roleListQuery.OrgIds[i]
orgId, _ := strconv.ParseInt(orgIdString, 10, 64)
orgIds = append(orgIds, orgId)
}
req.InOrgIds = orgIds
}
roleList, err := creationUserGateway.RoleSearch(req)
if err != nil {
... ...