切换导航条
此项目
正在载入...
登录
allied-creation
/
allied-creation-gateway
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
tangxuhui
3 years ago
提交
7d396a56091db4f6cac493291bdff6154e0a2c44
2 个父辈
817c5b85
da36edaa
Merge branch 'dev' of
http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway
into dev
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
36 行增加
和
3 行删除
pkg/application/web/roles/service/roles.go
pkg/application/web/users/service/users.go
pkg/infrastructure/service_gateway/allied_creation_user/module_role.go
pkg/infrastructure/service_gateway/allied_creation_user/param_role.go
pkg/application/web/roles/service/roles.go
查看文件 @
7d396a5
...
...
@@ -68,9 +68,9 @@ func (rolesService *RolesService) RoleGet(roleGetQuery *query.RoleGetQuery) (int
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
}
relatedUser
,
err
:=
creationUserGateway
.
Role
Get
RelatedUser
(
allied_creation_user
.
ReqRoleGetRelatedUser
{
relatedUser
,
err
:=
creationUserGateway
.
RoleRelatedUser
(
allied_creation_user
.
ReqRoleGetRelatedUser
{
RoleId
:
int64
(
roleId
),
OrgId
:
roleGetQuery
.
Operator
.
OrgId
,
OrgId
s
:
roleGetQuery
.
Operator
.
OrgIds
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
...
...
pkg/application/web/users/service/users.go
查看文件 @
7d396a5
...
...
@@ -376,7 +376,6 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery *
Offset
:
(
cooperationUserListQuery
.
PageNumber
-
1
)
*
cooperationUserListQuery
.
PageSize
,
Limit
:
cooperationUserListQuery
.
PageSize
,
CompanyId
:
cooperationUserListQuery
.
Operator
.
CompanyId
,
OrganizationId
:
cooperationUserListQuery
.
Operator
.
OrgId
,
DepartmentId
:
0
,
UserName
:
cooperationUserListQuery
.
UserName
,
CooperationCompany
:
cooperationUserListQuery
.
CooperationCompany
,
...
...
pkg/infrastructure/service_gateway/allied_creation_user/module_role.go
查看文件 @
7d396a5
...
...
@@ -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"
...
...
pkg/infrastructure/service_gateway/allied_creation_user/param_role.go
查看文件 @
7d396a5
...
...
@@ -162,6 +162,8 @@ type (
RoleId
int64
`json:"roleId"`
OrgId
int64
`json:"orgId"`
DepartmentId
int64
`json:"departmentId"`
// 组织ID
OrgIds
[]
int64
`cname:"组织ID" json:"orgIds,omitempty"`
}
DataRoleGetRelatedUser
struct
{
...
...
请
注册
或
登录
后发表评论