...
|
...
|
@@ -121,21 +121,31 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) ( |
|
|
|
|
|
// 编辑角色关联权限菜单的前置准备数据
|
|
|
func (rolesService *RolesService) RoleMenuBeforeEdit(roleMenuBeforeEditQuery *query.RoleMenuBeforeEditQuery) (interface{}, error) {
|
|
|
//creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
// roleMenuBeforeEditQuery.Operator.CompanyId,
|
|
|
// roleMenuBeforeEditQuery.Operator.OrgId,
|
|
|
// roleMenuBeforeEditQuery.Operator.UserId)
|
|
|
//roleId, _ := strconv.Atoi(roleMenuBeforeEditQuery.RoleId)
|
|
|
//roles, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{
|
|
|
// OrgId: roleMenuBeforeEditQuery.Operator.OrgId,
|
|
|
// Limit: 999,
|
|
|
// RoleType: 1,
|
|
|
//})
|
|
|
//if err != nil {
|
|
|
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
//}
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
|
|
|
roleMenuBeforeEditQuery.Operator.CompanyId,
|
|
|
roleMenuBeforeEditQuery.Operator.OrgId,
|
|
|
roleMenuBeforeEditQuery.Operator.UserId)
|
|
|
roleId, _ := strconv.Atoi(roleMenuBeforeEditQuery.RoleId)
|
|
|
roles, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{
|
|
|
OrgId: roleMenuBeforeEditQuery.Operator.OrgId,
|
|
|
Limit: 999,
|
|
|
RoleType: 1,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
return nil, nil
|
|
|
menus, err := creationUserGateway.RoleGetAccessMenus(allied_creation_user.ReqRoleGetAccessMenus{
|
|
|
RoleId: int64(roleId),
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
result := map[string]interface{}{
|
|
|
"roles": roles.Roles,
|
|
|
"menus": menus.Menus,
|
|
|
}
|
|
|
return result, nil
|
|
|
}
|
|
|
|
|
|
// 编辑角色关联用户的前置准备数据
|
...
|
...
|
|