正在显示
14 个修改的文件
包含
245 行增加
和
43 行删除
| @@ -4,9 +4,13 @@ import ( | @@ -4,9 +4,13 @@ import ( | ||
| 4 | "fmt" | 4 | "fmt" |
| 5 | 5 | ||
| 6 | "github.com/beego/beego/v2/core/validation" | 6 | "github.com/beego/beego/v2/core/validation" |
| 7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" | ||
| 7 | ) | 8 | ) |
| 8 | 9 | ||
| 9 | type CompanyUserEnableCommand struct { | 10 | type CompanyUserEnableCommand struct { |
| 11 | + //操作人 | ||
| 12 | + Operator domain.Operator `json:"-"` | ||
| 13 | + //用户id | ||
| 10 | UsersIds []int64 `json:"usersIds,omitempty"` | 14 | UsersIds []int64 `json:"usersIds,omitempty"` |
| 11 | // 启用状态(启用:1 禁用:2) | 15 | // 启用状态(启用:1 禁用:2) |
| 12 | EnableStatus int `json:"enableStatus,omitempty"` | 16 | EnableStatus int `json:"enableStatus,omitempty"` |
| @@ -4,10 +4,13 @@ import ( | @@ -4,10 +4,13 @@ import ( | ||
| 4 | "fmt" | 4 | "fmt" |
| 5 | 5 | ||
| 6 | "github.com/beego/beego/v2/core/validation" | 6 | "github.com/beego/beego/v2/core/validation" |
| 7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" | ||
| 7 | ) | 8 | ) |
| 8 | 9 | ||
| 9 | type CompanyUserResetPasswordCommand struct { | 10 | type CompanyUserResetPasswordCommand struct { |
| 10 | - UsersIds []int64 `json:"usersIds" valid:"Required"` | 11 | + //操作人 |
| 12 | + Operator domain.Operator `json:"-"` | ||
| 13 | + UsersIds []int64 `json:"usersIds" valid:"Required"` | ||
| 11 | } | 14 | } |
| 12 | 15 | ||
| 13 | func (companyUserResetPasswordCommand *CompanyUserResetPasswordCommand) Valid(validation *validation.Validation) { | 16 | func (companyUserResetPasswordCommand *CompanyUserResetPasswordCommand) Valid(validation *validation.Validation) { |
| @@ -4,11 +4,12 @@ import ( | @@ -4,11 +4,12 @@ import ( | ||
| 4 | "fmt" | 4 | "fmt" |
| 5 | 5 | ||
| 6 | "github.com/beego/beego/v2/core/validation" | 6 | "github.com/beego/beego/v2/core/validation" |
| 7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" | ||
| 7 | ) | 8 | ) |
| 8 | 9 | ||
| 9 | type CooperationUserAddCommand struct { | 10 | type CooperationUserAddCommand struct { |
| 10 | - // 用户编号 | ||
| 11 | - UsersId int64 `json:"usersId" valid:"Required"` | 11 | + //操作人 |
| 12 | + Operator domain.Operator `json:"-"` | ||
| 12 | // 用户编号 | 13 | // 用户编号 |
| 13 | UsersCode string `json:"usersCode" valid:"Required"` | 14 | UsersCode string `json:"usersCode" valid:"Required"` |
| 14 | // 用户姓名 | 15 | // 用户姓名 |
| @@ -16,15 +17,18 @@ type CooperationUserAddCommand struct { | @@ -16,15 +17,18 @@ type CooperationUserAddCommand struct { | ||
| 16 | // 共创公司 | 17 | // 共创公司 |
| 17 | CooperationCompany string `json:"cooperationCompany" valid:"Required"` | 18 | CooperationCompany string `json:"cooperationCompany" valid:"Required"` |
| 18 | // 共创公司到期时间 | 19 | // 共创公司到期时间 |
| 19 | - CooperationDeadline string `json:"cooperationDeadline" valid:"Required"` | 20 | + CooperationDeadline int64 `json:"cooperationDeadline" valid:"Required"` |
| 20 | // 启用状态(启用:1 禁用:2) | 21 | // 启用状态(启用:1 禁用:2) |
| 21 | EnableStatus int `json:"enableStatus" valid:"Required"` | 22 | EnableStatus int `json:"enableStatus" valid:"Required"` |
| 22 | // 邮箱 | 23 | // 邮箱 |
| 23 | Email string `json:"email" valid:"Required"` | 24 | Email string `json:"email" valid:"Required"` |
| 25 | + //头像 | ||
| 26 | + Avatar string `json:"avatar"` | ||
| 27 | + Phone string `json:"phone" valid:"Required"` | ||
| 24 | } | 28 | } |
| 25 | 29 | ||
| 26 | func (cooperationUserAddCommand *CooperationUserAddCommand) Valid(validation *validation.Validation) { | 30 | func (cooperationUserAddCommand *CooperationUserAddCommand) Valid(validation *validation.Validation) { |
| 27 | - validation.SetError("CustomValid", "未实现的自定义认证") | 31 | + |
| 28 | } | 32 | } |
| 29 | 33 | ||
| 30 | func (cooperationUserAddCommand *CooperationUserAddCommand) ValidateCommand() error { | 34 | func (cooperationUserAddCommand *CooperationUserAddCommand) ValidateCommand() error { |
| @@ -4,16 +4,20 @@ import ( | @@ -4,16 +4,20 @@ import ( | ||
| 4 | "fmt" | 4 | "fmt" |
| 5 | 5 | ||
| 6 | "github.com/beego/beego/v2/core/validation" | 6 | "github.com/beego/beego/v2/core/validation" |
| 7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" | ||
| 7 | ) | 8 | ) |
| 8 | 9 | ||
| 9 | type CooperationUserEnableCommand struct { | 10 | type CooperationUserEnableCommand struct { |
| 11 | + //操作人 | ||
| 12 | + Operator domain.Operator `json:"-"` | ||
| 13 | + //用户id | ||
| 10 | UsersIds []int64 `json:"usersIds,omitempty"` | 14 | UsersIds []int64 `json:"usersIds,omitempty"` |
| 11 | // 启用状态(启用:1 禁用:2) | 15 | // 启用状态(启用:1 禁用:2) |
| 12 | EnableStatus int `json:"enableStatus,omitempty"` | 16 | EnableStatus int `json:"enableStatus,omitempty"` |
| 13 | } | 17 | } |
| 14 | 18 | ||
| 15 | func (cooperationUserEnableCommand *CooperationUserEnableCommand) Valid(validation *validation.Validation) { | 19 | func (cooperationUserEnableCommand *CooperationUserEnableCommand) Valid(validation *validation.Validation) { |
| 16 | - validation.SetError("CustomValid", "未实现的自定义认证") | 20 | + |
| 17 | } | 21 | } |
| 18 | 22 | ||
| 19 | func (cooperationUserEnableCommand *CooperationUserEnableCommand) ValidateCommand() error { | 23 | func (cooperationUserEnableCommand *CooperationUserEnableCommand) ValidateCommand() error { |
| @@ -4,14 +4,16 @@ import ( | @@ -4,14 +4,16 @@ import ( | ||
| 4 | "fmt" | 4 | "fmt" |
| 5 | 5 | ||
| 6 | "github.com/beego/beego/v2/core/validation" | 6 | "github.com/beego/beego/v2/core/validation" |
| 7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" | ||
| 7 | ) | 8 | ) |
| 8 | 9 | ||
| 9 | type CooperationUserResetPasswordCommand struct { | 10 | type CooperationUserResetPasswordCommand struct { |
| 10 | - UsersIds []int64 `json:"usersIds" valid:"Required"` | 11 | + //操作人 |
| 12 | + Operator domain.Operator `json:"-"` | ||
| 13 | + UsersIds []int64 `json:"usersIds" valid:"Required"` | ||
| 11 | } | 14 | } |
| 12 | 15 | ||
| 13 | func (cooperationUserResetPasswordCommand *CooperationUserResetPasswordCommand) Valid(validation *validation.Validation) { | 16 | func (cooperationUserResetPasswordCommand *CooperationUserResetPasswordCommand) Valid(validation *validation.Validation) { |
| 14 | - validation.SetError("CustomValid", "未实现的自定义认证") | ||
| 15 | } | 17 | } |
| 16 | 18 | ||
| 17 | func (cooperationUserResetPasswordCommand *CooperationUserResetPasswordCommand) ValidateCommand() error { | 19 | func (cooperationUserResetPasswordCommand *CooperationUserResetPasswordCommand) ValidateCommand() error { |
| @@ -4,9 +4,12 @@ import ( | @@ -4,9 +4,12 @@ import ( | ||
| 4 | "fmt" | 4 | "fmt" |
| 5 | 5 | ||
| 6 | "github.com/beego/beego/v2/core/validation" | 6 | "github.com/beego/beego/v2/core/validation" |
| 7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" | ||
| 7 | ) | 8 | ) |
| 8 | 9 | ||
| 9 | type CooperationUserUpdateCommand struct { | 10 | type CooperationUserUpdateCommand struct { |
| 11 | + //操作人 | ||
| 12 | + Operator domain.Operator `json:"-"` | ||
| 10 | // 用户编号 | 13 | // 用户编号 |
| 11 | UsersId int64 `json:"usersId" valid:"Required"` | 14 | UsersId int64 `json:"usersId" valid:"Required"` |
| 12 | // 用户编号 | 15 | // 用户编号 |
| @@ -16,15 +19,19 @@ type CooperationUserUpdateCommand struct { | @@ -16,15 +19,19 @@ type CooperationUserUpdateCommand struct { | ||
| 16 | // 共创公司 | 19 | // 共创公司 |
| 17 | CooperationCompany string `json:"cooperationCompany" valid:"Required"` | 20 | CooperationCompany string `json:"cooperationCompany" valid:"Required"` |
| 18 | // 共创公司到期时间 | 21 | // 共创公司到期时间 |
| 19 | - CooperationDeadline string `json:"cooperationDeadline" valid:"Required"` | 22 | + CooperationDeadline int64 `json:"cooperationDeadline" valid:"Required"` |
| 20 | // 启用状态(启用:1 禁用:2) | 23 | // 启用状态(启用:1 禁用:2) |
| 21 | EnableStatus int `json:"enableStatus" valid:"Required"` | 24 | EnableStatus int `json:"enableStatus" valid:"Required"` |
| 22 | // 邮箱 | 25 | // 邮箱 |
| 23 | Email string `json:"email" valid:"Required"` | 26 | Email string `json:"email" valid:"Required"` |
| 27 | + //头像 | ||
| 28 | + Avatar string `json:"avatar"` | ||
| 29 | + | ||
| 30 | + Phone string `json:"phone" valid:"Required"` | ||
| 24 | } | 31 | } |
| 25 | 32 | ||
| 26 | func (cooperationUserUpdateCommand *CooperationUserUpdateCommand) Valid(validation *validation.Validation) { | 33 | func (cooperationUserUpdateCommand *CooperationUserUpdateCommand) Valid(validation *validation.Validation) { |
| 27 | - validation.SetError("CustomValid", "未实现的自定义认证") | 34 | + |
| 28 | } | 35 | } |
| 29 | 36 | ||
| 30 | func (cooperationUserUpdateCommand *CooperationUserUpdateCommand) ValidateCommand() error { | 37 | func (cooperationUserUpdateCommand *CooperationUserUpdateCommand) ValidateCommand() error { |
| @@ -9,3 +9,23 @@ type UserListItem struct { | @@ -9,3 +9,23 @@ type UserListItem struct { | ||
| 9 | UserId int64 | 9 | UserId int64 |
| 10 | UserName string | 10 | UserName string |
| 11 | } | 11 | } |
| 12 | + | ||
| 13 | +type CooperationUserInfo struct { | ||
| 14 | + UserId string `json:"userId"` | ||
| 15 | + //用户编号 | ||
| 16 | + UserCode string `json:"userCode"` | ||
| 17 | + // 用户状态,1启用,2禁用 | ||
| 18 | + EnableStatus int32 `json:"enableStatus"` | ||
| 19 | + // 共创公司 | ||
| 20 | + CooperationCompany string `json:"cooperationCompany"` | ||
| 21 | + // 共创公司到期时间 | ||
| 22 | + CooperationDeadline int64 `json:"cooperationDeadline"` | ||
| 23 | + // 用户姓名 | ||
| 24 | + UserName string `json:"userName"` | ||
| 25 | + // 邮箱 | ||
| 26 | + Email string `json:"email"` | ||
| 27 | + // 手机号码 | ||
| 28 | + Phone string `json:"phone"` | ||
| 29 | + //头像 | ||
| 30 | + Avatar string `json:"avatar"` | ||
| 31 | +} |
| @@ -4,9 +4,12 @@ import ( | @@ -4,9 +4,12 @@ import ( | ||
| 4 | "fmt" | 4 | "fmt" |
| 5 | 5 | ||
| 6 | "github.com/beego/beego/v2/core/validation" | 6 | "github.com/beego/beego/v2/core/validation" |
| 7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" | ||
| 7 | ) | 8 | ) |
| 8 | 9 | ||
| 9 | type CooperationUserGetQuery struct { | 10 | type CooperationUserGetQuery struct { |
| 11 | + //操作人 | ||
| 12 | + Operator domain.Operator `json:"-"` | ||
| 10 | // 用户编号 | 13 | // 用户编号 |
| 11 | UsersId int64 `json:"usersId" valid:"Required"` | 14 | UsersId int64 `json:"usersId" valid:"Required"` |
| 12 | } | 15 | } |
| 1 | package service | 1 | package service |
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | + "strconv" | ||
| 5 | + "time" | ||
| 6 | + | ||
| 4 | "github.com/linmadan/egglib-go/core/application" | 7 | "github.com/linmadan/egglib-go/core/application" |
| 5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/command" | 8 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/command" |
| 6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/dto" | 9 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/dto" |
| @@ -27,8 +30,15 @@ func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command. | @@ -27,8 +30,15 @@ func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command. | ||
| 27 | 30 | ||
| 28 | // 启用禁用公司用户信息 | 31 | // 启用禁用公司用户信息 |
| 29 | func (usersService *UsersService) CompanyUserEnable(companyUserEnableCommand *command.CompanyUserEnableCommand) (interface{}, error) { | 32 | func (usersService *UsersService) CompanyUserEnable(companyUserEnableCommand *command.CompanyUserEnableCommand) (interface{}, error) { |
| 30 | - | ||
| 31 | - return nil, nil | 33 | + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( |
| 34 | + companyUserEnableCommand.Operator.CompanyId, | ||
| 35 | + companyUserEnableCommand.Operator.OrgId, | ||
| 36 | + companyUserEnableCommand.Operator.UserId) | ||
| 37 | + result, err := creationUserGateway.UserBatchEnable(allied_creation_user.ReqBatchEnableUser{ | ||
| 38 | + UserIds: companyUserEnableCommand.UsersIds, | ||
| 39 | + EnableStatus: companyUserEnableCommand.EnableStatus, | ||
| 40 | + }) | ||
| 41 | + return result, err | ||
| 32 | } | 42 | } |
| 33 | 43 | ||
| 34 | // 返回公司用户信息列表 | 44 | // 返回公司用户信息列表 |
| @@ -71,8 +81,15 @@ func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.Co | @@ -71,8 +81,15 @@ func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.Co | ||
| 71 | 81 | ||
| 72 | // 批量重置密码 | 82 | // 批量重置密码 |
| 73 | func (usersService *UsersService) CompanyUserResetPassword(companyUserResetPasswordCommand *command.CompanyUserResetPasswordCommand) (interface{}, error) { | 83 | func (usersService *UsersService) CompanyUserResetPassword(companyUserResetPasswordCommand *command.CompanyUserResetPasswordCommand) (interface{}, error) { |
| 74 | - | ||
| 75 | - return nil, nil | 84 | + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( |
| 85 | + companyUserResetPasswordCommand.Operator.CompanyId, | ||
| 86 | + companyUserResetPasswordCommand.Operator.OrgId, | ||
| 87 | + companyUserResetPasswordCommand.Operator.UserId) | ||
| 88 | + result, err := creationUserGateway.UserBatchResetPassword(allied_creation_user.ReqBatchResetPasswordUser{ | ||
| 89 | + Password: "", | ||
| 90 | + UserIds: companyUserResetPasswordCommand.UsersIds, | ||
| 91 | + }) | ||
| 92 | + return result, err | ||
| 76 | } | 93 | } |
| 77 | 94 | ||
| 78 | // 更新公司用户信息 | 95 | // 更新公司用户信息 |
| @@ -83,19 +100,63 @@ func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *co | @@ -83,19 +100,63 @@ func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *co | ||
| 83 | 100 | ||
| 84 | // 创建共创用户信息 | 101 | // 创建共创用户信息 |
| 85 | func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand *command.CooperationUserAddCommand) (interface{}, error) { | 102 | func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand *command.CooperationUserAddCommand) (interface{}, error) { |
| 86 | - | ||
| 87 | - return nil, nil | 103 | + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( |
| 104 | + cooperationUserAddCommand.Operator.CompanyId, | ||
| 105 | + cooperationUserAddCommand.Operator.OrgId, | ||
| 106 | + cooperationUserAddCommand.Operator.UserId) | ||
| 107 | + result, err := creationUserGateway.CooperatorUserCreate(allied_creation_user.ReqCreateCooperatorUser{ | ||
| 108 | + CooperationCompany: cooperationUserAddCommand.CooperationCompany, | ||
| 109 | + CooperationDeadline: time.Unix(cooperationUserAddCommand.CooperationDeadline, 0), | ||
| 110 | + Email: cooperationUserAddCommand.Email, | ||
| 111 | + EnableStatus: cooperationUserAddCommand.EnableStatus, | ||
| 112 | + UserCode: cooperationUserAddCommand.UsersCode, | ||
| 113 | + UserName: cooperationUserAddCommand.UsersName, | ||
| 114 | + Avatar: cooperationUserAddCommand.Avatar, | ||
| 115 | + OrgId: cooperationUserAddCommand.Operator.OrgId, | ||
| 116 | + Phone: cooperationUserAddCommand.Phone, | ||
| 117 | + Password: "", | ||
| 118 | + }) | ||
| 119 | + return result, err | ||
| 88 | } | 120 | } |
| 89 | 121 | ||
| 90 | // 启用禁用共创用户信息 | 122 | // 启用禁用共创用户信息 |
| 91 | func (usersService *UsersService) CooperationUserEnable(cooperationUserEnableCommand *command.CooperationUserEnableCommand) (interface{}, error) { | 123 | func (usersService *UsersService) CooperationUserEnable(cooperationUserEnableCommand *command.CooperationUserEnableCommand) (interface{}, error) { |
| 92 | - return nil, nil | 124 | + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( |
| 125 | + cooperationUserEnableCommand.Operator.CompanyId, | ||
| 126 | + cooperationUserEnableCommand.Operator.OrgId, | ||
| 127 | + cooperationUserEnableCommand.Operator.UserId) | ||
| 128 | + result, err := creationUserGateway.UserBatchEnable(allied_creation_user.ReqBatchEnableUser{ | ||
| 129 | + UserIds: cooperationUserEnableCommand.UsersIds, | ||
| 130 | + EnableStatus: cooperationUserEnableCommand.EnableStatus, | ||
| 131 | + }) | ||
| 132 | + return result, err | ||
| 93 | } | 133 | } |
| 94 | 134 | ||
| 95 | // 获取共创用户信息 | 135 | // 获取共创用户信息 |
| 96 | func (usersService *UsersService) CooperationUserGet(cooperationUserGetQuery *query.CooperationUserGetQuery) (interface{}, error) { | 136 | func (usersService *UsersService) CooperationUserGet(cooperationUserGetQuery *query.CooperationUserGetQuery) (interface{}, error) { |
| 97 | - | ||
| 98 | - return nil, nil | 137 | + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( |
| 138 | + cooperationUserGetQuery.Operator.CompanyId, | ||
| 139 | + cooperationUserGetQuery.Operator.OrgId, | ||
| 140 | + cooperationUserGetQuery.Operator.UserId) | ||
| 141 | + result, err := creationUserGateway.UserGet(allied_creation_user.ReqGateUser{ | ||
| 142 | + UserId: cooperationUserGetQuery.UsersId, | ||
| 143 | + }) | ||
| 144 | + if err != nil { | ||
| 145 | + return nil, err | ||
| 146 | + } | ||
| 147 | + deadline := result.CooperationInfo.CooperationDeadline.Unix() | ||
| 148 | + userInfo := dto.CooperationUserInfo{ | ||
| 149 | + UserId: strconv.FormatInt(result.UserId, 10), | ||
| 150 | + UserCode: result.UserCode, | ||
| 151 | + EnableStatus: int32(result.EnableStatus), | ||
| 152 | + CooperationCompany: result.CooperationInfo.CooperationCompany, | ||
| 153 | + CooperationDeadline: deadline, | ||
| 154 | + UserName: result.UserInfo.UserName, | ||
| 155 | + Email: result.UserInfo.Email, | ||
| 156 | + Phone: result.UserInfo.Phone, | ||
| 157 | + Avatar: result.UserInfo.Avatar, | ||
| 158 | + } | ||
| 159 | + return userInfo, nil | ||
| 99 | } | 160 | } |
| 100 | 161 | ||
| 101 | // 返回共创用户信息列表 | 162 | // 返回共创用户信息列表 |
| @@ -106,14 +167,36 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery * | @@ -106,14 +167,36 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery * | ||
| 106 | 167 | ||
| 107 | // 批量重置密码 | 168 | // 批量重置密码 |
| 108 | func (usersService *UsersService) CooperationUserResetPassword(cooperationUserResetPasswordCommand *command.CooperationUserResetPasswordCommand) (interface{}, error) { | 169 | func (usersService *UsersService) CooperationUserResetPassword(cooperationUserResetPasswordCommand *command.CooperationUserResetPasswordCommand) (interface{}, error) { |
| 109 | - | ||
| 110 | - return nil, nil | 170 | + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( |
| 171 | + cooperationUserResetPasswordCommand.Operator.CompanyId, | ||
| 172 | + cooperationUserResetPasswordCommand.Operator.OrgId, | ||
| 173 | + cooperationUserResetPasswordCommand.Operator.UserId) | ||
| 174 | + result, err := creationUserGateway.UserBatchResetPassword(allied_creation_user.ReqBatchResetPasswordUser{ | ||
| 175 | + Password: "", | ||
| 176 | + UserIds: cooperationUserResetPasswordCommand.UsersIds, | ||
| 177 | + }) | ||
| 178 | + return result, err | ||
| 111 | } | 179 | } |
| 112 | 180 | ||
| 113 | // 编辑共创用户信息 | 181 | // 编辑共创用户信息 |
| 114 | func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCommand *command.CooperationUserUpdateCommand) (interface{}, error) { | 182 | func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCommand *command.CooperationUserUpdateCommand) (interface{}, error) { |
| 115 | - | ||
| 116 | - return nil, nil | 183 | + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( |
| 184 | + cooperationUserUpdateCommand.Operator.CompanyId, | ||
| 185 | + cooperationUserUpdateCommand.Operator.OrgId, | ||
| 186 | + cooperationUserUpdateCommand.Operator.UserId) | ||
| 187 | + result, err := creationUserGateway.CooperatorUserUpdate(allied_creation_user.ReqUpdateCooperatorUser{ | ||
| 188 | + UserId: cooperationUserUpdateCommand.UsersId, | ||
| 189 | + CooperationCompany: cooperationUserUpdateCommand.CooperationCompany, | ||
| 190 | + CooperationDeadline: time.Unix(cooperationUserUpdateCommand.CooperationDeadline, 0), | ||
| 191 | + Email: cooperationUserUpdateCommand.Email, | ||
| 192 | + EnableStatus: cooperationUserUpdateCommand.EnableStatus, | ||
| 193 | + UserCode: cooperationUserUpdateCommand.UsersCode, | ||
| 194 | + UserName: cooperationUserUpdateCommand.UsersName, | ||
| 195 | + Avatar: cooperationUserUpdateCommand.Avatar, | ||
| 196 | + OrgId: cooperationUserUpdateCommand.Operator.OrgId, | ||
| 197 | + Phone: cooperationUserUpdateCommand.Phone, | ||
| 198 | + }) | ||
| 199 | + return result, err | ||
| 117 | } | 200 | } |
| 118 | 201 | ||
| 119 | func NewUsersService(options map[string]interface{}) *UsersService { | 202 | func NewUsersService(options map[string]interface{}) *UsersService { |
| @@ -17,7 +17,7 @@ type CompanyInfo struct { | @@ -17,7 +17,7 @@ type CompanyInfo struct { | ||
| 17 | // 联系人 | 17 | // 联系人 |
| 18 | Contacts string `json:"contacts"` | 18 | Contacts string `json:"contacts"` |
| 19 | // 注册时间 | 19 | // 注册时间 |
| 20 | - RegistTime time.Time `json:"registTime"` | 20 | + RegisteredTime time.Time `json:"registeredTime"` |
| 21 | // 注册状态 1:已注册 2:待认证 3:已认证 | 21 | // 注册状态 1:已注册 2:待认证 3:已认证 |
| 22 | RegistStatus int `json:"registStatus"` | 22 | RegistStatus int `json:"registStatus"` |
| 23 | } | 23 | } |
| 1 | package domain | 1 | package domain |
| 2 | 2 | ||
| 3 | -import "time" | ||
| 4 | - | ||
| 5 | const ( | 3 | const ( |
| 6 | loginTokenSecret string = "bbe35ad433dd8e67" | 4 | loginTokenSecret string = "bbe35ad433dd8e67" |
| 7 | ) | 5 | ) |
| 8 | 6 | ||
| 9 | type LoginToken struct { | 7 | type LoginToken struct { |
| 8 | + UserId int64 `json:"userId"` | ||
| 9 | + UserBaseId int64 `json:"userBaseId"` | ||
| 10 | // 账号 | 10 | // 账号 |
| 11 | Account string `json:"account"` | 11 | Account string `json:"account"` |
| 12 | // 对应平台 | 12 | // 对应平台 |
| @@ -14,19 +14,6 @@ type LoginToken struct { | @@ -14,19 +14,6 @@ type LoginToken struct { | ||
| 14 | // 公司id | 14 | // 公司id |
| 15 | CompanyId int64 `json:"companyId"` | 15 | CompanyId int64 `json:"companyId"` |
| 16 | // 组织id | 16 | // 组织id |
| 17 | - OrganizationId int64 `json:"organizationId"` | ||
| 18 | - // 登录凭证存储 | ||
| 19 | - AccessToken string `json:"accessToken"` | ||
| 20 | - // 刷新登录凭证 | ||
| 21 | - RefreshToken string `json:"refreshToken"` | ||
| 22 | - // 登录凭证过期时间,时间戳精度秒 | ||
| 23 | - AccessExpired int64 `json:"accessExpired"` | ||
| 24 | - // 刷新登录凭证过期时间,时间戳精度秒 | ||
| 25 | - RefreshExpired int64 `json:"refreshExpired"` | ||
| 26 | - // 创建时间 | ||
| 27 | - CreatedTime time.Time `json:"createdTime"` | ||
| 28 | - // 更新时间 | ||
| 29 | - UpdatedTime time.Time `json:"updatedTime"` | ||
| 30 | } | 17 | } |
| 31 | 18 | ||
| 32 | func (t *LoginToken) GenerateAccessToken() error { | 19 | func (t *LoginToken) GenerateAccessToken() error { |
pkg/domain/operator.go
0 → 100644
| @@ -146,6 +146,39 @@ type ( | @@ -146,6 +146,39 @@ type ( | ||
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | DataGateUser struct { | 148 | DataGateUser struct { |
| 149 | + UserId int64 `json:"userId"` | ||
| 150 | + UserBaseId int64 `json:"userBaseId"` | ||
| 151 | + UserType int64 `json:"userType"` | ||
| 152 | + UserCode string `json:"userCode"` | ||
| 153 | + EnableStatus int64 `json:"enableStatus"` | ||
| 154 | + CooperationInfo struct { | ||
| 155 | + CooperationCompany string `json:"cooperationCompany"` | ||
| 156 | + CooperationDeadline time.Time `json:"cooperationDeadline"` | ||
| 157 | + } `json:"cooperationInfo"` | ||
| 158 | + UserInfo struct { | ||
| 159 | + Phone string `json:"phone"` | ||
| 160 | + UserCode string `json:"userCode"` | ||
| 161 | + Email string `json:"email"` | ||
| 162 | + UserName string `json:"userName"` | ||
| 163 | + Avatar string `json:"avatar"` | ||
| 164 | + } `json:"userInfo"` | ||
| 165 | + Company struct { | ||
| 166 | + CompanyId int64 `json:"companyId"` | ||
| 167 | + CompanyName string `json:"companyName"` | ||
| 168 | + Scale string `json:"scale"` | ||
| 169 | + IndustryCategory string `json:"industryCategory"` | ||
| 170 | + RegisteredTime time.Time `json:"registeredTime"` | ||
| 171 | + Status int64 `json:"status"` | ||
| 172 | + } `json:"company"` | ||
| 173 | + Org struct { | ||
| 174 | + OrgId int64 `json:"orgId"` | ||
| 175 | + OrgCode string `json:"orgCode"` | ||
| 176 | + OrgName string `json:"orgName"` | ||
| 177 | + } `json:"org"` | ||
| 178 | + Department struct { | ||
| 179 | + DepartmentId int64 `json:"departmentId"` | ||
| 180 | + DepartmentName string `json:"departmentName"` | ||
| 181 | + } `json:"department"` | ||
| 149 | } | 182 | } |
| 150 | ) | 183 | ) |
| 151 | 184 | ||
| @@ -162,8 +195,8 @@ type ( | @@ -162,8 +195,8 @@ type ( | ||
| 162 | //批量修改用户启用状态 | 195 | //批量修改用户启用状态 |
| 163 | type ( | 196 | type ( |
| 164 | ReqBatchEnableUser struct { | 197 | ReqBatchEnableUser struct { |
| 165 | - UserId int64 `json:"userId"` | ||
| 166 | - EnableStatus int `json:"enableStatus"` | 198 | + UserIds []int64 `json:"userIds"` |
| 199 | + EnableStatus int `json:"enableStatus"` //启用状态(启用:1 禁用:2 注销:3) | ||
| 167 | } | 200 | } |
| 168 | 201 | ||
| 169 | DataBatchEnableUser struct { | 202 | DataBatchEnableUser struct { |
| @@ -173,8 +206,8 @@ type ( | @@ -173,8 +206,8 @@ type ( | ||
| 173 | //批量重置密码 | 206 | //批量重置密码 |
| 174 | type ( | 207 | type ( |
| 175 | ReqBatchResetPasswordUser struct { | 208 | ReqBatchResetPasswordUser struct { |
| 176 | - Password string | ||
| 177 | - UserIds []int64 | 209 | + Password string `json:"password"` |
| 210 | + UserIds []int64 `json:"userIds"` | ||
| 178 | } | 211 | } |
| 179 | DataBatchResetPasswordUser struct { | 212 | DataBatchResetPasswordUser struct { |
| 180 | } | 213 | } |
| @@ -183,6 +216,26 @@ type ( | @@ -183,6 +216,26 @@ type ( | ||
| 183 | //创建共创用户 | 216 | //创建共创用户 |
| 184 | type ( | 217 | type ( |
| 185 | ReqCreateCooperatorUser struct { | 218 | ReqCreateCooperatorUser struct { |
| 219 | + // 共创公司 | ||
| 220 | + CooperationCompany string ` json:"cooperationCompany"` | ||
| 221 | + // 共创到期时间 | ||
| 222 | + CooperationDeadline time.Time `json:"cooperationDeadline"` | ||
| 223 | + // 邮箱 | ||
| 224 | + Email string `json:"email"` | ||
| 225 | + // 启用状态(启用:1 禁用:2 注销:3) | ||
| 226 | + EnableStatus int `json:"enableStatus" ` | ||
| 227 | + // 用户编号 企业内标识 | ||
| 228 | + UserCode string `json:"userCode"` | ||
| 229 | + // 用户姓名 | ||
| 230 | + UserName string ` json:"userName"` | ||
| 231 | + // 头像 | ||
| 232 | + Avatar string ` json:"avatar"` | ||
| 233 | + // 组织ID | ||
| 234 | + OrgId int64 `json:"orgId"` | ||
| 235 | + // 手机号码 | ||
| 236 | + Phone string `json:"phone"` | ||
| 237 | + //密码 | ||
| 238 | + Password string `json:"password"` | ||
| 186 | } | 239 | } |
| 187 | DataCreateCooperatorUser struct { | 240 | DataCreateCooperatorUser struct { |
| 188 | } | 241 | } |
| @@ -192,6 +245,24 @@ type ( | @@ -192,6 +245,24 @@ type ( | ||
| 192 | type ( | 245 | type ( |
| 193 | ReqUpdateCooperatorUser struct { | 246 | ReqUpdateCooperatorUser struct { |
| 194 | UserId int64 `json:"userId"` | 247 | UserId int64 `json:"userId"` |
| 248 | + // 共创公司 | ||
| 249 | + CooperationCompany string ` json:"cooperationCompany"` | ||
| 250 | + // 共创到期时间 | ||
| 251 | + CooperationDeadline time.Time `json:"cooperationDeadline"` | ||
| 252 | + // 邮箱 | ||
| 253 | + Email string `json:"email"` | ||
| 254 | + // 启用状态(启用:1 禁用:2 注销:3) | ||
| 255 | + EnableStatus int `json:"enableStatus" ` | ||
| 256 | + // 用户编号 企业内标识 | ||
| 257 | + UserCode string `json:"userCode" ` | ||
| 258 | + // 用户姓名 | ||
| 259 | + UserName string ` json:"userName"` | ||
| 260 | + // 头像 | ||
| 261 | + Avatar string ` json:"avatar"` | ||
| 262 | + // 组织ID | ||
| 263 | + OrgId int64 `json:"orgId" ` | ||
| 264 | + // 手机号码 | ||
| 265 | + Phone string `json:"phone" ` | ||
| 195 | } | 266 | } |
| 196 | DataUpdateCooperatorUser struct { | 267 | DataUpdateCooperatorUser struct { |
| 197 | } | 268 | } |
-
请 注册 或 登录 后发表评论