+ GetRolesUserList
This commit is contained in:
@@ -132,6 +132,37 @@ func (c *User2Controller) GetRoleUserList() {
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 批量得到角色包括的用户列表
|
||||
// @Description 批量得到角色包括的用户列表
|
||||
// @Param token header string true "认证token"
|
||||
// @Param roleNames query string true "角色名"
|
||||
// @Param storeIDs query string false "门店ID(如果是全局角色不用填)"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetRolesUserList [get]
|
||||
func (c *User2Controller) GetRolesUserList() {
|
||||
c.callGetRolesUserList(func(params *tUser2GetRolesUserListParams) (retVal interface{}, errCode string, err error) {
|
||||
var roleNames []string
|
||||
var storeIDs []int
|
||||
if err = jxutils.Strings2Objs(params.RoleNames, &roleNames, params.StoreIDs, &storeIDs); err == nil {
|
||||
var roleList []*authz.RoleInfo
|
||||
for _, roleName := range roleNames {
|
||||
if len(storeIDs) == 0 {
|
||||
roleList = append(roleList, autils.NewRole(roleName, 0))
|
||||
} else {
|
||||
if roleName == authz.StoreRoleBoss {
|
||||
for _, storeID := range storeIDs {
|
||||
roleList = append(roleList, autils.NewRole(roleName, storeID))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
retVal, err = cms.GetRolesUserList(params.Ctx, roleList)
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 给指定用户添加角色列表
|
||||
// @Description 给指定用户添加角色列表
|
||||
// @Param token header string true "认证token"
|
||||
|
||||
Reference in New Issue
Block a user