作者 yangfu

用户角色修改

... ... @@ -11,9 +11,9 @@ type CompanyUserAddCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 用户编号
UsersCode string `json:"usersCode" valid:"Required"`
UsersCode string `json:"userCode" valid:"Required"`
// 用户姓名
UsersName string `json:"usersName" valid:"Required"`
UsersName string `json:"userName" valid:"Required"`
// 组织ID
OrgId string `json:"orgId" valid:"Required"`
// 部门id
... ... @@ -25,11 +25,11 @@ type CompanyUserAddCommand struct {
// 邮箱
Email string `json:"email" valid:"Required"`
// 关联的组织机构
UsersOrg []string `json:"usersOrg"`
UsersOrg []string `json:"userOrg"`
// 关联的用户
UsersRole []string `json:"usersRole"`
UsersRole []string `json:"userRole"`
// 头像
Avator string `json:"avator" valid:"Required"`
Avatar string `json:"avatar" valid:"Required"`
}
func (companyUserAddCommand *CompanyUserAddCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -127,10 +127,13 @@ func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command.
EnableStatus: companyUserAddCommand.EnableStatus,
UserName: companyUserAddCommand.UsersName,
Phone: companyUserAddCommand.Phone,
Avatar: companyUserAddCommand.Avator,
Email: companyUserAddCommand.Avator,
Avatar: companyUserAddCommand.Avatar,
Email: companyUserAddCommand.Avatar,
Password: "123456", //TODO 填充密码
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
data := struct {
UserId string `json:"userId"`
... ... @@ -169,7 +172,7 @@ func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.Co
Offset: (companyUserListQuery.PageNumber - 1) * companyUserListQuery.PageSize,
Limit: companyUserListQuery.PageSize,
CompanyId: companyUserListQuery.Operator.CompanyId,
OrganizationId: companyUserListQuery.Operator.OrgId,
OrganizationId: 0,
DepartmentId: 0,
UserName: companyUserListQuery.UserName,
DepName: companyUserListQuery.DepartmentName,
... ...
... ... @@ -33,6 +33,8 @@ type (
RoleName string `json:"roleName"`
// 组织ID
OrgId int64 `json:"orgId"`
// 匹配多个组织
InOrgIds []int64 `cname:"匹配多个组织" json:"inOrgIds,omitempty"`
}
DataRoleSearch struct {
... ...
... ... @@ -80,6 +80,8 @@ type (
Phone string `json:"phone"`
// 用户类型
UserType int `cname:"用户类型 1:普通用户 2:共创用户 1024:企业注册用户" json:"userType,omitempty"`
// 匹配多个组织
InOrgIds []int64 `cname:"匹配多个组织" json:"inOrgIds,omitempty"`
// 实时拉取数据 (获取最新的)
PullRealTime bool `cname:"拉取最新数据" json:"pullRealTime,omitempty"`
}
... ...