作者 yangfu

增加roleType过滤,返回

... ... @@ -18,6 +18,8 @@ type RoleListQuery struct {
RoleName string `json:"roleName"`
OrgName string `json:"orgName"`
RoleType int `json:"roleType"`
}
func (roleListQuery *RoleListQuery) Valid(validation *validation.Validation) {
... ...
package service
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"strconv"
"github.com/linmadan/egglib-go/core/application"
... ... @@ -93,6 +94,7 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (
OrgName: roleListQuery.OrgName,
RoleName: roleListQuery.RoleName,
InOrgIds: roleListQuery.Operator.OrgIds,
RoleType: roleListQuery.RoleType,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ... @@ -111,6 +113,9 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (
if int64(v.OrgID) == roleListQuery.Operator.OrgId {
item.AuthFlag = true
}
if (item.RoleType & domain.UserTypeCompanyAdmin) > 0 {
item.AuthFlag = false
}
result = append(result, item)
}
var cnt int64 = roleList.Count
... ...
... ... @@ -40,6 +40,7 @@ type UserRole struct {
RoleID string `json:"roleId"`
RoleName string `json:"roleName"`
OrgName string `json:"orgName"`
RoleType int `json:"roleType"`
Description string `json:"desc"`
}
... ...
... ... @@ -74,6 +74,7 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp
RoleID: strconv.Itoa(v.RoleID),
RoleName: v.RoleName,
OrgName: v.Ext.OrgName,
RoleType: v.RoleType,
})
}
user := dto.CompanyUserInfo{
... ...
... ... @@ -47,6 +47,7 @@ type UserDetail struct {
UserRole []struct {
RoleID int `json:"roleId"`
RoleName string `json:"roleName"`
RoleType int `json:"roleType"`
Ext struct {
OrgName string `json:"orgName"`
} `json:"ext,omitempty"`
... ...