Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway into dev
正在显示
5 个修改的文件
包含
29 行增加
和
19 行删除
lastupdate.tmp
0 → 100644
1 | +{"F:\\go\\src\\allied-creation\\allied-creation-gateway\\pkg\\port\\beego\\routers":1627896972308508600} |
@@ -10,13 +10,13 @@ import ( | @@ -10,13 +10,13 @@ import ( | ||
10 | type CompanyUserUpdateCommand struct { | 10 | type CompanyUserUpdateCommand struct { |
11 | //操作人 | 11 | //操作人 |
12 | Operator domain.Operator `json:"-"` | 12 | Operator domain.Operator `json:"-"` |
13 | - UsersId string `json:"usersId" valid:"Required"` | 13 | + UsersId string `json:"userId" valid:"Required"` |
14 | // 用户编号 | 14 | // 用户编号 |
15 | - UsersCode string `json:"usersCode,omitempty"` | 15 | + UsersCode string `json:"userCode,omitempty"` |
16 | // 用户名称 | 16 | // 用户名称 |
17 | - UsersName string `json:"usersName,omitempty"` | 17 | + UsersName string `json:"userName,omitempty"` |
18 | // 组织机构id | 18 | // 组织机构id |
19 | - OrganizationId string `json:"organizationId,omitempty"` | 19 | + OrganizationId string `json:"orgId,omitempty"` |
20 | // 部门id | 20 | // 部门id |
21 | DepartmentId string `json:"departmentId,omitempty"` | 21 | DepartmentId string `json:"departmentId,omitempty"` |
22 | // 启用状态(启用:1 禁用:2) | 22 | // 启用状态(启用:1 禁用:2) |
@@ -26,11 +26,19 @@ type CompanyUserUpdateCommand struct { | @@ -26,11 +26,19 @@ type CompanyUserUpdateCommand struct { | ||
26 | // 邮箱 | 26 | // 邮箱 |
27 | Email string `json:"email,omitempty"` | 27 | Email string `json:"email,omitempty"` |
28 | // 关联的组织机构 | 28 | // 关联的组织机构 |
29 | - UsersOrg []string `json:"usersOrg,omitempty"` | 29 | + UserOrg []Org `json:"userOrg,omitempty"` |
30 | // 关联的组织结构 | 30 | // 关联的组织结构 |
31 | - UsersRole []string `json:"usersRole,omitempty"` | 31 | + UserRole []Role `json:"userRole,omitempty"` |
32 | // 头像 | 32 | // 头像 |
33 | - Avator string `json:"avator,omitempty"` | 33 | + Avatar string `json:"avatar,omitempty"` |
34 | +} | ||
35 | + | ||
36 | +type Org struct { | ||
37 | + OrgId string `json:"orgId"` | ||
38 | +} | ||
39 | + | ||
40 | +type Role struct { | ||
41 | + RoleId string `json:"roleId"` | ||
34 | } | 42 | } |
35 | 43 | ||
36 | func (companyUserUpdateCommand *CompanyUserUpdateCommand) Valid(validation *validation.Validation) { | 44 | func (companyUserUpdateCommand *CompanyUserUpdateCommand) Valid(validation *validation.Validation) { |
@@ -40,9 +40,9 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp | @@ -40,9 +40,9 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp | ||
40 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 40 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
41 | } | 41 | } |
42 | var ( | 42 | var ( |
43 | - usersOrg []dto.UserOrg | ||
44 | - userRole []dto.UserRole | ||
45 | - userMenu []dto.UserMenu | 43 | + usersOrg []dto.UserOrg = make([]dto.UserOrg, 0) |
44 | + userRole []dto.UserRole = make([]dto.UserRole, 0) | ||
45 | + userMenu []dto.UserMenu = make([]dto.UserMenu, 0) | ||
46 | ) | 46 | ) |
47 | 47 | ||
48 | for _, v := range resultMenu.Menus { | 48 | for _, v := range resultMenu.Menus { |
@@ -223,18 +223,18 @@ func (usersService *UsersService) CompanyUserResetPassword(companyUserResetPassw | @@ -223,18 +223,18 @@ func (usersService *UsersService) CompanyUserResetPassword(companyUserResetPassw | ||
223 | func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *command.CompanyUserUpdateCommand) (interface{}, error) { | 223 | func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *command.CompanyUserUpdateCommand) (interface{}, error) { |
224 | creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( | 224 | creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( |
225 | companyUserUpdateCommand.Operator) | 225 | companyUserUpdateCommand.Operator) |
226 | - departmentId, _ := strconv.Atoi(companyUserUpdateCommand.OrganizationId) | 226 | + departmentId, _ := strconv.Atoi(companyUserUpdateCommand.DepartmentId) |
227 | orgId, _ := strconv.Atoi(companyUserUpdateCommand.OrganizationId) | 227 | orgId, _ := strconv.Atoi(companyUserUpdateCommand.OrganizationId) |
228 | userOrg := []int64{} | 228 | userOrg := []int64{} |
229 | userRole := []int64{} | 229 | userRole := []int64{} |
230 | - for _, v := range companyUserUpdateCommand.UsersOrg { | ||
231 | - id, err := strconv.Atoi(v) | 230 | + for _, v := range companyUserUpdateCommand.UserOrg { |
231 | + id, err := strconv.Atoi(v.OrgId) | ||
232 | if err == nil { | 232 | if err == nil { |
233 | userOrg = append(userOrg, int64(id)) | 233 | userOrg = append(userOrg, int64(id)) |
234 | } | 234 | } |
235 | } | 235 | } |
236 | - for _, v := range companyUserUpdateCommand.UsersRole { | ||
237 | - id, err := strconv.Atoi(v) | 236 | + for _, v := range companyUserUpdateCommand.UserRole { |
237 | + id, err := strconv.Atoi(v.RoleId) | ||
238 | if err == nil { | 238 | if err == nil { |
239 | userRole = append(userRole, int64(id)) | 239 | userRole = append(userRole, int64(id)) |
240 | } | 240 | } |
@@ -251,8 +251,8 @@ func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *co | @@ -251,8 +251,8 @@ func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *co | ||
251 | EnableStatus: companyUserUpdateCommand.EnableStatus, | 251 | EnableStatus: companyUserUpdateCommand.EnableStatus, |
252 | UserName: companyUserUpdateCommand.UsersName, | 252 | UserName: companyUserUpdateCommand.UsersName, |
253 | Phone: companyUserUpdateCommand.Phone, | 253 | Phone: companyUserUpdateCommand.Phone, |
254 | - Avatar: companyUserUpdateCommand.Avator, | ||
255 | - Email: companyUserUpdateCommand.Avator, | 254 | + Avatar: companyUserUpdateCommand.Avatar, |
255 | + Email: companyUserUpdateCommand.Email, | ||
256 | }) | 256 | }) |
257 | if err != nil { | 257 | if err != nil { |
258 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 258 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
@@ -3,6 +3,7 @@ package allied_creation_user | @@ -3,6 +3,7 @@ package allied_creation_user | ||
3 | import ( | 3 | import ( |
4 | "encoding/json" | 4 | "encoding/json" |
5 | "fmt" | 5 | "fmt" |
6 | + "strconv" | ||
6 | 7 | ||
7 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway" | 8 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway" |
8 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log" | 9 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log" |
@@ -74,7 +75,7 @@ func (gateway HttplibAlliedCreationUser) UserCreate(param ReqCreateUser) (*DataC | @@ -74,7 +75,7 @@ func (gateway HttplibAlliedCreationUser) UserCreate(param ReqCreateUser) (*DataC | ||
74 | 75 | ||
75 | //UserUpdate 更新用户 | 76 | //UserUpdate 更新用户 |
76 | func (gateway HttplibAlliedCreationUser) UserUpdate(param ReqUpdateUser) (*DataUpdateUser, error) { | 77 | func (gateway HttplibAlliedCreationUser) UserUpdate(param ReqUpdateUser) (*DataUpdateUser, error) { |
77 | - url := gateway.baseUrL + "/user" | 78 | + url := gateway.baseUrL + "/user/" + strconv.Itoa(int(param.UserId)) |
78 | method := "put" | 79 | method := "put" |
79 | req := gateway.CreateRequest(url, method) | 80 | req := gateway.CreateRequest(url, method) |
80 | //TODO traceID | 81 | //TODO traceID |
@@ -7,7 +7,7 @@ import ( | @@ -7,7 +7,7 @@ import ( | ||
7 | 7 | ||
8 | func init() { | 8 | func init() { |
9 | web.Router("/v1/web/users/company-user", &web_client.UsersController{}, "Post:CompanyUserAdd") | 9 | web.Router("/v1/web/users/company-user", &web_client.UsersController{}, "Post:CompanyUserAdd") |
10 | - web.Router("/v1/web/users/company-user", &web_client.UsersController{}, "Put:CompanyUserUpdate") | 10 | + web.Router("/v1/web/users/company-user/:userId", &web_client.UsersController{}, "Put:CompanyUserUpdate") |
11 | web.Router("/v1/web/users/company-user/search", &web_client.UsersController{}, "Post:CompanyUserList") | 11 | web.Router("/v1/web/users/company-user/search", &web_client.UsersController{}, "Post:CompanyUserList") |
12 | web.Router("/v1/web/users/company-user/:userId", &web_client.UsersController{}, "Get:CompanyUserGet") | 12 | web.Router("/v1/web/users/company-user/:userId", &web_client.UsersController{}, "Get:CompanyUserGet") |
13 | web.Router("/v1/web/users/company-user/enable", &web_client.UsersController{}, "Put:CompanyUserEnable") | 13 | web.Router("/v1/web/users/company-user/enable", &web_client.UsersController{}, "Put:CompanyUserEnable") |
-
请 注册 或 登录 后发表评论