...
|
...
|
@@ -296,6 +296,38 @@ func (gateway HttplibAlliedCreationUser) RoleGetRelatedUser(param ReqRoleGetRela |
|
|
return &data, err
|
|
|
}
|
|
|
|
|
|
// RoleGetRelatedUser 获取角色相关联的用户
|
|
|
func (gateway HttplibAlliedCreationUser) RoleRelatedUser(param ReqRoleGetRelatedUser) (*DataRoleGetRelatedUser, error) {
|
|
|
//v := url.Values{}
|
|
|
urlStr := gateway.baseUrL + "/role/" + strconv.FormatInt(param.RoleId, 10) + "/related-user"
|
|
|
method := "post"
|
|
|
req := gateway.CreateRequest(urlStr, method)
|
|
|
log.Logger.Debug("向用户模块请求数据:获取角色相关联的用户。", map[string]interface{}{
|
|
|
"api": method + ":" + urlStr,
|
|
|
"param": param,
|
|
|
})
|
|
|
req, err := req.JSONBody(param)
|
|
|
if err != nil {
|
|
|
return nil, fmt.Errorf("请求获取角色相关联的用户失败:%w", err)
|
|
|
}
|
|
|
|
|
|
byteResult, err := req.Bytes()
|
|
|
if err != nil {
|
|
|
return nil, fmt.Errorf("获取获取角色相关联的用户失败:%w", err)
|
|
|
}
|
|
|
log.Logger.Debug("获取用户模块请求数据:获取角色相关联的用户。", map[string]interface{}{
|
|
|
"result": string(byteResult),
|
|
|
})
|
|
|
var result service_gateway.GatewayResponse
|
|
|
err = json.Unmarshal(byteResult, &result)
|
|
|
if err != nil {
|
|
|
return nil, fmt.Errorf("解析获取角色相关联的用户:%w", err)
|
|
|
}
|
|
|
var data DataRoleGetRelatedUser
|
|
|
err = gateway.GetResponseData(result, &data)
|
|
|
return &data, err
|
|
|
}
|
|
|
|
|
|
// RoleGetAccessMenus 获取角色菜单
|
|
|
func (gateway HttplibAlliedCreationUser) RoleGetAccessMenus(param ReqRoleGetAccessMenus) (*DataRoleGetAccessMenus, error) {
|
|
|
urlStr := gateway.baseUrL + "/role/" + strconv.FormatInt(param.RoleId, 10) + "/access-menus"
|
...
|
...
|
|