作者 tangxuhui

添加下拉列表接口

... ... @@ -424,22 +424,25 @@ func (usersService *UsersService) SelectorCompanyRole(selectorQuery *query.Compa
selectorQuery.Operator.OrgId,
selectorQuery.Operator.UserId)
result, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{
Limit: selectorQuery.PageSize,
Offset: (selectorQuery.PageNumber - 1) * selectorQuery.PageSize,
Limit: selectorQuery.PageSize,
Offset: (selectorQuery.PageNumber - 1) * selectorQuery.PageSize,
RoleName: selectorQuery.RoleName,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
var (
dataList []dto.UserOrg
// item dto.UserOrg
dataList []dto.UserRole
item dto.UserRole
)
// for _, v := range result.Orgs {
// item = dto.UserOrg{
// OrgID: strconv.Itoa(v.OrgID),
// OrgName: v.OrgName,
// }
// dataList = append(dataList, item)
// }
for _, v := range result.Roles {
item = dto.UserRole{
RoleID: strconv.Itoa(v.RoleID),
RoleName: v.RoleName,
OrgName: v.Ext.OrgName,
Descript: v.Desc,
}
dataList = append(dataList, item)
}
return int64(result.Count), dataList, nil
}
... ...
... ... @@ -129,3 +129,13 @@ func (controller *UsersController) SelectorCompanyOrg() {
cnt, data, err := usersService.SelectorCompanyOrg(selectorQuery)
controller.returnPageListData(cnt, data, err, selectorQuery.PageNumber)
}
//SelectorCompanyRole 角色选择表
func (controller *UsersController) SelectorCompanyRole() {
usersService := service.NewUsersService(nil)
selectorQuery := &query.CompanyRoleSelectorQuery{}
controller.Unmarshal(selectorQuery)
selectorQuery.Operator = controller.GetOperator()
cnt, data, err := usersService.SelectorCompanyRole(selectorQuery)
controller.returnPageListData(cnt, data, err, selectorQuery.PageNumber)
}
... ...
... ... @@ -19,5 +19,6 @@ func init() {
web.Router("/v1/web/users/cooperation-user/enable", &web_client.UsersController{}, "Put:CooperationUserEnable")
web.Router("/v1/web/users/cooperation-user/reset-password", &web_client.UsersController{}, "Put:CooperationUserResetPassword")
web.Router("/v1/web/users/selector/org", &web_client.UsersController{}, "Post:SelectorCompanyOrg")
web.Router("/v1/web/users/selector/role", &web_client.UsersController{}, "Post:SelectorCompanyRole")
}
... ...