Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway into dev
正在显示
4 个修改的文件
包含
36 行增加
和
3 行删除
@@ -68,9 +68,9 @@ func (rolesService *RolesService) RoleGet(roleGetQuery *query.RoleGetQuery) (int | @@ -68,9 +68,9 @@ func (rolesService *RolesService) RoleGet(roleGetQuery *query.RoleGetQuery) (int | ||
68 | if err != nil { | 68 | if err != nil { |
69 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 69 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
70 | } | 70 | } |
71 | - relatedUser, err := creationUserGateway.RoleGetRelatedUser(allied_creation_user.ReqRoleGetRelatedUser{ | 71 | + relatedUser, err := creationUserGateway.RoleRelatedUser(allied_creation_user.ReqRoleGetRelatedUser{ |
72 | RoleId: int64(roleId), | 72 | RoleId: int64(roleId), |
73 | - OrgId: roleGetQuery.Operator.OrgId, | 73 | + OrgIds: roleGetQuery.Operator.OrgIds, |
74 | }) | 74 | }) |
75 | if err != nil { | 75 | if err != nil { |
76 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 76 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
@@ -376,7 +376,6 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery * | @@ -376,7 +376,6 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery * | ||
376 | Offset: (cooperationUserListQuery.PageNumber - 1) * cooperationUserListQuery.PageSize, | 376 | Offset: (cooperationUserListQuery.PageNumber - 1) * cooperationUserListQuery.PageSize, |
377 | Limit: cooperationUserListQuery.PageSize, | 377 | Limit: cooperationUserListQuery.PageSize, |
378 | CompanyId: cooperationUserListQuery.Operator.CompanyId, | 378 | CompanyId: cooperationUserListQuery.Operator.CompanyId, |
379 | - OrganizationId: cooperationUserListQuery.Operator.OrgId, | ||
380 | DepartmentId: 0, | 379 | DepartmentId: 0, |
381 | UserName: cooperationUserListQuery.UserName, | 380 | UserName: cooperationUserListQuery.UserName, |
382 | CooperationCompany: cooperationUserListQuery.CooperationCompany, | 381 | CooperationCompany: cooperationUserListQuery.CooperationCompany, |
@@ -296,6 +296,38 @@ func (gateway HttplibAlliedCreationUser) RoleGetRelatedUser(param ReqRoleGetRela | @@ -296,6 +296,38 @@ func (gateway HttplibAlliedCreationUser) RoleGetRelatedUser(param ReqRoleGetRela | ||
296 | return &data, err | 296 | return &data, err |
297 | } | 297 | } |
298 | 298 | ||
299 | +// RoleGetRelatedUser 获取角色相关联的用户 | ||
300 | +func (gateway HttplibAlliedCreationUser) RoleRelatedUser(param ReqRoleGetRelatedUser) (*DataRoleGetRelatedUser, error) { | ||
301 | + //v := url.Values{} | ||
302 | + urlStr := gateway.baseUrL + "/role/" + strconv.FormatInt(param.RoleId, 10) + "/related-user" | ||
303 | + method := "post" | ||
304 | + req := gateway.CreateRequest(urlStr, method) | ||
305 | + log.Logger.Debug("向用户模块请求数据:获取角色相关联的用户。", map[string]interface{}{ | ||
306 | + "api": method + ":" + urlStr, | ||
307 | + "param": param, | ||
308 | + }) | ||
309 | + req, err := req.JSONBody(param) | ||
310 | + if err != nil { | ||
311 | + return nil, fmt.Errorf("请求获取角色相关联的用户失败:%w", err) | ||
312 | + } | ||
313 | + | ||
314 | + byteResult, err := req.Bytes() | ||
315 | + if err != nil { | ||
316 | + return nil, fmt.Errorf("获取获取角色相关联的用户失败:%w", err) | ||
317 | + } | ||
318 | + log.Logger.Debug("获取用户模块请求数据:获取角色相关联的用户。", map[string]interface{}{ | ||
319 | + "result": string(byteResult), | ||
320 | + }) | ||
321 | + var result service_gateway.GatewayResponse | ||
322 | + err = json.Unmarshal(byteResult, &result) | ||
323 | + if err != nil { | ||
324 | + return nil, fmt.Errorf("解析获取角色相关联的用户:%w", err) | ||
325 | + } | ||
326 | + var data DataRoleGetRelatedUser | ||
327 | + err = gateway.GetResponseData(result, &data) | ||
328 | + return &data, err | ||
329 | +} | ||
330 | + | ||
299 | // RoleGetAccessMenus 获取角色菜单 | 331 | // RoleGetAccessMenus 获取角色菜单 |
300 | func (gateway HttplibAlliedCreationUser) RoleGetAccessMenus(param ReqRoleGetAccessMenus) (*DataRoleGetAccessMenus, error) { | 332 | func (gateway HttplibAlliedCreationUser) RoleGetAccessMenus(param ReqRoleGetAccessMenus) (*DataRoleGetAccessMenus, error) { |
301 | urlStr := gateway.baseUrL + "/role/" + strconv.FormatInt(param.RoleId, 10) + "/access-menus" | 333 | urlStr := gateway.baseUrL + "/role/" + strconv.FormatInt(param.RoleId, 10) + "/access-menus" |
@@ -162,6 +162,8 @@ type ( | @@ -162,6 +162,8 @@ type ( | ||
162 | RoleId int64 `json:"roleId"` | 162 | RoleId int64 `json:"roleId"` |
163 | OrgId int64 `json:"orgId"` | 163 | OrgId int64 `json:"orgId"` |
164 | DepartmentId int64 `json:"departmentId"` | 164 | DepartmentId int64 `json:"departmentId"` |
165 | + // 组织ID | ||
166 | + OrgIds []int64 `cname:"组织ID" json:"orgIds,omitempty"` | ||
165 | } | 167 | } |
166 | 168 | ||
167 | DataRoleGetRelatedUser struct { | 169 | DataRoleGetRelatedUser struct { |
-
请 注册 或 登录 后发表评论