正在显示
8 个修改的文件
包含
114 行增加
和
25 行删除
@@ -2,8 +2,8 @@ package service | @@ -2,8 +2,8 @@ package service | ||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "github.com/linmadan/egglib-go/core/application" | 4 | "github.com/linmadan/egglib-go/core/application" |
5 | - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/custommenu/command" | ||
6 | - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/custommenu/query" | 5 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/custommenu/command" |
6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/custommenu/query" | ||
7 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user" | 7 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user" |
8 | ) | 8 | ) |
9 | 9 |
@@ -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 RoleUserInfoQuery struct { | 10 | type RoleUserInfoQuery struct { |
11 | + // 操作人 | ||
12 | + Operator domain.Operator `json:"-"` | ||
10 | // 角色ID | 13 | // 角色ID |
11 | RoleId int64 `json:"roleId" valid:"Required"` | 14 | RoleId int64 `json:"roleId" valid:"Required"` |
12 | } | 15 | } |
1 | +package web_client | ||
2 | + | ||
3 | +import ( | ||
4 | + "github.com/linmadan/egglib-go/web/beego" | ||
5 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" | ||
6 | +) | ||
7 | + | ||
8 | +type baseController struct { | ||
9 | + beego.BaseController | ||
10 | +} | ||
11 | + | ||
12 | +func (controller *baseController) returnPageListData(count int64, data interface{}, err error, pageNumber int) { | ||
13 | + dataMap := map[string]interface{}{ | ||
14 | + "totalRow": count, | ||
15 | + "pageNumber": pageNumber, | ||
16 | + "list": data, | ||
17 | + } | ||
18 | + controller.Response(dataMap, err) | ||
19 | +} | ||
20 | + | ||
21 | +func (controller *baseController) GetUserId() int64 { | ||
22 | + return 1 | ||
23 | +} | ||
24 | + | ||
25 | +func (controller *baseController) GetCompanyId() int64 { | ||
26 | + return 1 | ||
27 | +} | ||
28 | + | ||
29 | +func (controller *baseController) GetUserBaseId() int64 { | ||
30 | + return 1 | ||
31 | +} | ||
32 | + | ||
33 | +func (controller *baseController) GetOrgId() int64 { | ||
34 | + return 1 | ||
35 | +} | ||
36 | + | ||
37 | +func (controller *baseController) GetOperator() domain.Operator { | ||
38 | + return domain.Operator{ | ||
39 | + UserId: 1, | ||
40 | + CompanyId: 1, | ||
41 | + OrgId: 1, | ||
42 | + UserBaseId: 1, | ||
43 | + } | ||
44 | +} |
1 | +package web_client | ||
2 | + | ||
3 | +import ( | ||
4 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/custommenu/command" | ||
5 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/custommenu/query" | ||
6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/custommenu/service" | ||
7 | +) | ||
8 | + | ||
9 | +type MenuController struct { | ||
10 | + baseController | ||
11 | +} | ||
12 | + | ||
13 | +func (controller *MenuController) MenuList() { | ||
14 | + menuService := service.NewMenuService(nil) | ||
15 | + menuListQuery := &query.MenuListQuery{} | ||
16 | + menuListQuery.Operator = controller.GetOperator() | ||
17 | + data, err := menuService.MenuList(menuListQuery) | ||
18 | + controller.Response(data, err) | ||
19 | +} | ||
20 | + | ||
21 | +func (controller *MenuController) MenuUpdate() { | ||
22 | + menuService := service.NewMenuService(nil) | ||
23 | + menuUpdateQuery := &command.MenuUpdateCommand{} | ||
24 | + controller.Unmarshal(menuUpdateQuery) | ||
25 | + menuUpdateQuery.Operator = controller.GetOperator() | ||
26 | + data, err := menuService.MenuUpdate(menuUpdateQuery) | ||
27 | + controller.Response(data, err) | ||
28 | +} | ||
29 | + | ||
30 | +func (controller *MenuController) MenuFavorite() { | ||
31 | + menuService := service.NewMenuService(nil) | ||
32 | + menuFavoriteCommand := &command.MenuFavoriteCommand{} | ||
33 | + controller.Unmarshal(menuFavoriteCommand) | ||
34 | + data, err := menuService.MenuFavorite(menuFavoriteCommand) | ||
35 | + controller.Response(data, err) | ||
36 | +} |
1 | package web_client | 1 | package web_client |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | - "github.com/linmadan/egglib-go/web/beego" | ||
5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/orgs/command" | 4 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/orgs/command" |
6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/orgs/query" | 5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/orgs/query" |
7 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/orgs/service" | 6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/orgs/service" |
8 | ) | 7 | ) |
9 | 8 | ||
10 | type OrgsController struct { | 9 | type OrgsController struct { |
11 | - beego.BaseController | 10 | + baseController |
12 | } | 11 | } |
13 | 12 | ||
14 | func (controller *OrgsController) OrgAdd() { | 13 | func (controller *OrgsController) OrgAdd() { |
15 | orgsService := service.NewOrgsService(nil) | 14 | orgsService := service.NewOrgsService(nil) |
16 | orgAddCommand := &command.OrgAddCommand{} | 15 | orgAddCommand := &command.OrgAddCommand{} |
17 | controller.Unmarshal(orgAddCommand) | 16 | controller.Unmarshal(orgAddCommand) |
17 | + orgAddCommand.Operator = controller.GetOperator() | ||
18 | data, err := orgsService.OrgAdd(orgAddCommand) | 18 | data, err := orgsService.OrgAdd(orgAddCommand) |
19 | controller.Response(data, err) | 19 | controller.Response(data, err) |
20 | } | 20 | } |
@@ -25,6 +25,7 @@ func (controller *OrgsController) OrgUpdate() { | @@ -25,6 +25,7 @@ func (controller *OrgsController) OrgUpdate() { | ||
25 | controller.Unmarshal(orgUpdateCommand) | 25 | controller.Unmarshal(orgUpdateCommand) |
26 | orgId := controller.GetString(":orgId") | 26 | orgId := controller.GetString(":orgId") |
27 | orgUpdateCommand.OrgId = orgId | 27 | orgUpdateCommand.OrgId = orgId |
28 | + orgUpdateCommand.Operator = controller.GetOperator() | ||
28 | data, err := orgsService.OrgUpdate(orgUpdateCommand) | 29 | data, err := orgsService.OrgUpdate(orgUpdateCommand) |
29 | controller.Response(data, err) | 30 | controller.Response(data, err) |
30 | } | 31 | } |
@@ -32,6 +33,8 @@ func (controller *OrgsController) OrgUpdate() { | @@ -32,6 +33,8 @@ func (controller *OrgsController) OrgUpdate() { | ||
32 | func (controller *OrgsController) OrgList() { | 33 | func (controller *OrgsController) OrgList() { |
33 | orgsService := service.NewOrgsService(nil) | 34 | orgsService := service.NewOrgsService(nil) |
34 | orgListQuery := &query.OrgListQuery{} | 35 | orgListQuery := &query.OrgListQuery{} |
36 | + controller.Unmarshal(orgListQuery) | ||
37 | + orgListQuery.Operator = controller.GetOperator() | ||
35 | data, err := orgsService.OrgList(orgListQuery) | 38 | data, err := orgsService.OrgList(orgListQuery) |
36 | controller.Response(data, err) | 39 | controller.Response(data, err) |
37 | } | 40 | } |
@@ -41,6 +44,7 @@ func (controller *OrgsController) OrgGet() { | @@ -41,6 +44,7 @@ func (controller *OrgsController) OrgGet() { | ||
41 | orgGetQuery := &query.OrgGetQuery{} | 44 | orgGetQuery := &query.OrgGetQuery{} |
42 | orgId := controller.GetString(":orgId") | 45 | orgId := controller.GetString(":orgId") |
43 | orgGetQuery.OrgId = orgId | 46 | orgGetQuery.OrgId = orgId |
47 | + orgGetQuery.Operator = controller.GetOperator() | ||
44 | data, err := orgsService.OrgGet(orgGetQuery) | 48 | data, err := orgsService.OrgGet(orgGetQuery) |
45 | controller.Response(data, err) | 49 | controller.Response(data, err) |
46 | } | 50 | } |
1 | package web_client | 1 | package web_client |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | - "github.com/linmadan/egglib-go/web/beego" | ||
5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/roles/command" | 4 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/roles/command" |
6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/roles/query" | 5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/roles/query" |
7 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/roles/service" | 6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/roles/service" |
8 | ) | 7 | ) |
9 | 8 | ||
10 | type RolesController struct { | 9 | type RolesController struct { |
11 | - beego.BaseController | 10 | + baseController |
12 | } | 11 | } |
13 | 12 | ||
14 | -func (controller *RolesController) returnPageListData(count int64, data interface{}, err error, pageNumber int) { | ||
15 | - dataMap := map[string]interface{}{ | ||
16 | - "totalRow": count, | ||
17 | - "pageNumber": pageNumber, | ||
18 | - "list": data, | ||
19 | - } | ||
20 | - controller.Response(dataMap, err) | ||
21 | -} | ||
22 | func (controller *RolesController) RoleAdd() { | 13 | func (controller *RolesController) RoleAdd() { |
23 | rolesService := service.NewRolesService(nil) | 14 | rolesService := service.NewRolesService(nil) |
24 | roleAddCommand := &command.RoleAddCommand{} | 15 | roleAddCommand := &command.RoleAddCommand{} |
25 | controller.Unmarshal(roleAddCommand) | 16 | controller.Unmarshal(roleAddCommand) |
17 | + roleAddCommand.Operator = controller.GetOperator() | ||
26 | data, err := rolesService.RoleAdd(roleAddCommand) | 18 | data, err := rolesService.RoleAdd(roleAddCommand) |
27 | controller.Response(data, err) | 19 | controller.Response(data, err) |
28 | } | 20 | } |
@@ -33,6 +25,7 @@ func (controller *RolesController) RoleUpdate() { | @@ -33,6 +25,7 @@ func (controller *RolesController) RoleUpdate() { | ||
33 | controller.Unmarshal(roleUpdateCommand) | 25 | controller.Unmarshal(roleUpdateCommand) |
34 | roleId := controller.GetString(":roleId") | 26 | roleId := controller.GetString(":roleId") |
35 | roleUpdateCommand.RoleId = roleId | 27 | roleUpdateCommand.RoleId = roleId |
28 | + roleUpdateCommand.Operator = controller.GetOperator() | ||
36 | data, err := rolesService.RoleEdit(roleUpdateCommand) | 29 | data, err := rolesService.RoleEdit(roleUpdateCommand) |
37 | controller.Response(data, err) | 30 | controller.Response(data, err) |
38 | } | 31 | } |
@@ -41,6 +34,7 @@ func (controller *RolesController) RoleList() { | @@ -41,6 +34,7 @@ func (controller *RolesController) RoleList() { | ||
41 | rolesService := service.NewRolesService(nil) | 34 | rolesService := service.NewRolesService(nil) |
42 | roleListQuery := &query.RoleListQuery{} | 35 | roleListQuery := &query.RoleListQuery{} |
43 | controller.Unmarshal(roleListQuery) | 36 | controller.Unmarshal(roleListQuery) |
37 | + roleListQuery.Operator = controller.GetOperator() | ||
44 | cnt, data, err := rolesService.RoleList(roleListQuery) | 38 | cnt, data, err := rolesService.RoleList(roleListQuery) |
45 | controller.returnPageListData(cnt, data, err, roleListQuery.PageNumber) | 39 | controller.returnPageListData(cnt, data, err, roleListQuery.PageNumber) |
46 | } | 40 | } |
@@ -50,6 +44,7 @@ func (controller *RolesController) RoleGet() { | @@ -50,6 +44,7 @@ func (controller *RolesController) RoleGet() { | ||
50 | roleGetQuery := &query.RoleGetQuery{} | 44 | roleGetQuery := &query.RoleGetQuery{} |
51 | roleId := controller.GetString(":roleId") | 45 | roleId := controller.GetString(":roleId") |
52 | roleGetQuery.RoleId = roleId | 46 | roleGetQuery.RoleId = roleId |
47 | + roleGetQuery.Operator = controller.GetOperator() | ||
53 | data, err := rolesService.RoleGet(roleGetQuery) | 48 | data, err := rolesService.RoleGet(roleGetQuery) |
54 | controller.Response(data, err) | 49 | controller.Response(data, err) |
55 | } | 50 | } |
@@ -59,6 +54,7 @@ func (controller *RolesController) RoleUserInfo() { | @@ -59,6 +54,7 @@ func (controller *RolesController) RoleUserInfo() { | ||
59 | roleUserInfoQuery := &query.RoleUserInfoQuery{} | 54 | roleUserInfoQuery := &query.RoleUserInfoQuery{} |
60 | roleId, _ := controller.GetInt64(":roleId") | 55 | roleId, _ := controller.GetInt64(":roleId") |
61 | roleUserInfoQuery.RoleId = roleId | 56 | roleUserInfoQuery.RoleId = roleId |
57 | + roleUserInfoQuery.Operator = controller.GetOperator() | ||
62 | data, err := rolesService.RoleUserInfo(roleUserInfoQuery) | 58 | data, err := rolesService.RoleUserInfo(roleUserInfoQuery) |
63 | controller.Response(data, err) | 59 | controller.Response(data, err) |
64 | } | 60 | } |
@@ -67,6 +63,7 @@ func (controller *RolesController) RoleUserAdd() { | @@ -67,6 +63,7 @@ func (controller *RolesController) RoleUserAdd() { | ||
67 | rolesService := service.NewRolesService(nil) | 63 | rolesService := service.NewRolesService(nil) |
68 | roleUserAddQuery := &command.RoleUserAddCommand{} | 64 | roleUserAddQuery := &command.RoleUserAddCommand{} |
69 | controller.Unmarshal(roleUserAddQuery) | 65 | controller.Unmarshal(roleUserAddQuery) |
66 | + roleUserAddQuery.Operator = controller.GetOperator() | ||
70 | data, err := rolesService.RoleUserAdd(roleUserAddQuery) | 67 | data, err := rolesService.RoleUserAdd(roleUserAddQuery) |
71 | controller.Response(data, err) | 68 | controller.Response(data, err) |
72 | } | 69 | } |
@@ -75,6 +72,7 @@ func (controller *RolesController) RoleUserDelete() { | @@ -75,6 +72,7 @@ func (controller *RolesController) RoleUserDelete() { | ||
75 | rolesService := service.NewRolesService(nil) | 72 | rolesService := service.NewRolesService(nil) |
76 | roleUserDeleteQuery := &command.RoleUserDeleteCommand{} | 73 | roleUserDeleteQuery := &command.RoleUserDeleteCommand{} |
77 | controller.Unmarshal(roleUserDeleteQuery) | 74 | controller.Unmarshal(roleUserDeleteQuery) |
75 | + roleUserDeleteQuery.Operator = controller.GetOperator() | ||
78 | data, err := rolesService.RoleUserDelete(roleUserDeleteQuery) | 76 | data, err := rolesService.RoleUserDelete(roleUserDeleteQuery) |
79 | controller.Response(data, err) | 77 | controller.Response(data, err) |
80 | } | 78 | } |
@@ -99,6 +97,7 @@ func (controller *RolesController) RoleMenuEdit() { | @@ -99,6 +97,7 @@ func (controller *RolesController) RoleMenuEdit() { | ||
99 | controller.Unmarshal(roleMenuEditQuery) | 97 | controller.Unmarshal(roleMenuEditQuery) |
100 | roleId := controller.GetString(":roleId") | 98 | roleId := controller.GetString(":roleId") |
101 | roleMenuEditQuery.RoleId = roleId | 99 | roleMenuEditQuery.RoleId = roleId |
100 | + roleMenuEditQuery.Operator = controller.GetOperator() | ||
102 | data, err := rolesService.RoleMenuEdit(roleMenuEditQuery) | 101 | data, err := rolesService.RoleMenuEdit(roleMenuEditQuery) |
103 | controller.Response(data, err) | 102 | controller.Response(data, err) |
104 | } | 103 | } |
1 | package web_client | 1 | package web_client |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | - "github.com/linmadan/egglib-go/web/beego" | ||
5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/command" | 4 | "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/query" | 5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/query" |
7 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/service" | 6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/service" |
8 | ) | 7 | ) |
9 | 8 | ||
10 | type UsersController struct { | 9 | type UsersController struct { |
11 | - beego.BaseController | ||
12 | -} | ||
13 | - | ||
14 | -func (controller *UsersController) returnPageListData(count int64, data interface{}, err error, pageNumber int) { | ||
15 | - dataMap := map[string]interface{}{ | ||
16 | - "totalRow": count, | ||
17 | - "pageNumber": pageNumber, | ||
18 | - "list": data, | ||
19 | - } | ||
20 | - controller.Response(dataMap, err) | 10 | + baseController |
21 | } | 11 | } |
22 | 12 | ||
23 | func (controller *UsersController) CompanyUserAdd() { | 13 | func (controller *UsersController) CompanyUserAdd() { |
24 | usersService := service.NewUsersService(nil) | 14 | usersService := service.NewUsersService(nil) |
25 | companyUserAddCommand := &command.CompanyUserAddCommand{} | 15 | companyUserAddCommand := &command.CompanyUserAddCommand{} |
26 | controller.Unmarshal(companyUserAddCommand) | 16 | controller.Unmarshal(companyUserAddCommand) |
17 | + companyUserAddCommand.Operator = controller.GetOperator() | ||
27 | data, err := usersService.CompanyUserAdd(companyUserAddCommand) | 18 | data, err := usersService.CompanyUserAdd(companyUserAddCommand) |
28 | controller.Response(data, err) | 19 | controller.Response(data, err) |
29 | } | 20 | } |
@@ -32,6 +23,7 @@ func (controller *UsersController) CompanyUserUpdate() { | @@ -32,6 +23,7 @@ func (controller *UsersController) CompanyUserUpdate() { | ||
32 | usersService := service.NewUsersService(nil) | 23 | usersService := service.NewUsersService(nil) |
33 | companyUserUpdateCommand := &command.CompanyUserUpdateCommand{} | 24 | companyUserUpdateCommand := &command.CompanyUserUpdateCommand{} |
34 | controller.Unmarshal(companyUserUpdateCommand) | 25 | controller.Unmarshal(companyUserUpdateCommand) |
26 | + companyUserUpdateCommand.Operator = controller.GetOperator() | ||
35 | data, err := usersService.CompanyUserUpdate(companyUserUpdateCommand) | 27 | data, err := usersService.CompanyUserUpdate(companyUserUpdateCommand) |
36 | controller.Response(data, err) | 28 | controller.Response(data, err) |
37 | } | 29 | } |
@@ -40,6 +32,7 @@ func (controller *UsersController) CompanyUserList() { | @@ -40,6 +32,7 @@ func (controller *UsersController) CompanyUserList() { | ||
40 | usersService := service.NewUsersService(nil) | 32 | usersService := service.NewUsersService(nil) |
41 | companyUserListQuery := &query.CompanyUserListQuery{} | 33 | companyUserListQuery := &query.CompanyUserListQuery{} |
42 | controller.Unmarshal(companyUserListQuery) | 34 | controller.Unmarshal(companyUserListQuery) |
35 | + companyUserListQuery.Operator = controller.GetOperator() | ||
43 | cnt, data, err := usersService.CompanyUserList(companyUserListQuery) | 36 | cnt, data, err := usersService.CompanyUserList(companyUserListQuery) |
44 | controller.returnPageListData(cnt, data, err, companyUserListQuery.PageNumber) | 37 | controller.returnPageListData(cnt, data, err, companyUserListQuery.PageNumber) |
45 | } | 38 | } |
@@ -49,6 +42,7 @@ func (controller *UsersController) CompanyUserGet() { | @@ -49,6 +42,7 @@ func (controller *UsersController) CompanyUserGet() { | ||
49 | companyUserGetQuery := &query.CompanyUserGetQuery{} | 42 | companyUserGetQuery := &query.CompanyUserGetQuery{} |
50 | userId := controller.GetString(":userId") | 43 | userId := controller.GetString(":userId") |
51 | companyUserGetQuery.UsersId = userId | 44 | companyUserGetQuery.UsersId = userId |
45 | + companyUserGetQuery.Operator = controller.GetOperator() | ||
52 | data, err := usersService.CompanyUserGet(companyUserGetQuery) | 46 | data, err := usersService.CompanyUserGet(companyUserGetQuery) |
53 | controller.Response(data, err) | 47 | controller.Response(data, err) |
54 | } | 48 | } |
@@ -57,6 +51,7 @@ func (controller *UsersController) CompanyUserEnable() { | @@ -57,6 +51,7 @@ func (controller *UsersController) CompanyUserEnable() { | ||
57 | usersService := service.NewUsersService(nil) | 51 | usersService := service.NewUsersService(nil) |
58 | companyUserEnableCommand := &command.CompanyUserEnableCommand{} | 52 | companyUserEnableCommand := &command.CompanyUserEnableCommand{} |
59 | controller.Unmarshal(companyUserEnableCommand) | 53 | controller.Unmarshal(companyUserEnableCommand) |
54 | + companyUserEnableCommand.Operator = controller.GetOperator() | ||
60 | data, err := usersService.CompanyUserEnable(companyUserEnableCommand) | 55 | data, err := usersService.CompanyUserEnable(companyUserEnableCommand) |
61 | controller.Response(data, err) | 56 | controller.Response(data, err) |
62 | } | 57 | } |
@@ -65,6 +60,7 @@ func (controller *UsersController) CompanyUserResetPassword() { | @@ -65,6 +60,7 @@ func (controller *UsersController) CompanyUserResetPassword() { | ||
65 | usersService := service.NewUsersService(nil) | 60 | usersService := service.NewUsersService(nil) |
66 | companyUserResetPasswordCommand := &command.CompanyUserResetPasswordCommand{} | 61 | companyUserResetPasswordCommand := &command.CompanyUserResetPasswordCommand{} |
67 | controller.Unmarshal(companyUserResetPasswordCommand) | 62 | controller.Unmarshal(companyUserResetPasswordCommand) |
63 | + companyUserResetPasswordCommand.Operator = controller.GetOperator() | ||
68 | data, err := usersService.CompanyUserResetPassword(companyUserResetPasswordCommand) | 64 | data, err := usersService.CompanyUserResetPassword(companyUserResetPasswordCommand) |
69 | controller.Response(data, err) | 65 | controller.Response(data, err) |
70 | } | 66 | } |
@@ -73,6 +69,7 @@ func (controller *UsersController) CooperationUserAdd() { | @@ -73,6 +69,7 @@ func (controller *UsersController) CooperationUserAdd() { | ||
73 | usersService := service.NewUsersService(nil) | 69 | usersService := service.NewUsersService(nil) |
74 | cooperationUserAddCommand := &command.CooperationUserAddCommand{} | 70 | cooperationUserAddCommand := &command.CooperationUserAddCommand{} |
75 | controller.Unmarshal(cooperationUserAddCommand) | 71 | controller.Unmarshal(cooperationUserAddCommand) |
72 | + cooperationUserAddCommand.Operator = controller.GetOperator() | ||
76 | data, err := usersService.CooperationUserAdd(cooperationUserAddCommand) | 73 | data, err := usersService.CooperationUserAdd(cooperationUserAddCommand) |
77 | controller.Response(data, err) | 74 | controller.Response(data, err) |
78 | } | 75 | } |
@@ -81,6 +78,7 @@ func (controller *UsersController) CooperationUserUpdate() { | @@ -81,6 +78,7 @@ func (controller *UsersController) CooperationUserUpdate() { | ||
81 | usersService := service.NewUsersService(nil) | 78 | usersService := service.NewUsersService(nil) |
82 | cooperationUserUpdateCommand := &command.CooperationUserUpdateCommand{} | 79 | cooperationUserUpdateCommand := &command.CooperationUserUpdateCommand{} |
83 | controller.Unmarshal(cooperationUserUpdateCommand) | 80 | controller.Unmarshal(cooperationUserUpdateCommand) |
81 | + cooperationUserUpdateCommand.Operator = controller.GetOperator() | ||
84 | data, err := usersService.CooperationUserUpdate(cooperationUserUpdateCommand) | 82 | data, err := usersService.CooperationUserUpdate(cooperationUserUpdateCommand) |
85 | controller.Response(data, err) | 83 | controller.Response(data, err) |
86 | } | 84 | } |
@@ -89,6 +87,7 @@ func (controller *UsersController) CooperationUserList() { | @@ -89,6 +87,7 @@ func (controller *UsersController) CooperationUserList() { | ||
89 | usersService := service.NewUsersService(nil) | 87 | usersService := service.NewUsersService(nil) |
90 | cooperationUserListQuery := &query.CooperationUserListQuery{} | 88 | cooperationUserListQuery := &query.CooperationUserListQuery{} |
91 | controller.Unmarshal(cooperationUserListQuery) | 89 | controller.Unmarshal(cooperationUserListQuery) |
90 | + cooperationUserListQuery.Operator = controller.GetOperator() | ||
92 | cnt, data, err := usersService.CooperationUserList(cooperationUserListQuery) | 91 | cnt, data, err := usersService.CooperationUserList(cooperationUserListQuery) |
93 | controller.returnPageListData(cnt, data, err, cooperationUserListQuery.PageNumber) | 92 | controller.returnPageListData(cnt, data, err, cooperationUserListQuery.PageNumber) |
94 | } | 93 | } |
@@ -98,6 +97,7 @@ func (controller *UsersController) CooperationUserGet() { | @@ -98,6 +97,7 @@ func (controller *UsersController) CooperationUserGet() { | ||
98 | cooperationUserGetQuery := &query.CooperationUserGetQuery{} | 97 | cooperationUserGetQuery := &query.CooperationUserGetQuery{} |
99 | userId := controller.GetString(":userId") | 98 | userId := controller.GetString(":userId") |
100 | cooperationUserGetQuery.UsersId = userId | 99 | cooperationUserGetQuery.UsersId = userId |
100 | + cooperationUserGetQuery.Operator = controller.GetOperator() | ||
101 | data, err := usersService.CooperationUserGet(cooperationUserGetQuery) | 101 | data, err := usersService.CooperationUserGet(cooperationUserGetQuery) |
102 | controller.Response(data, err) | 102 | controller.Response(data, err) |
103 | } | 103 | } |
@@ -106,6 +106,7 @@ func (controller *UsersController) CooperationUserEnable() { | @@ -106,6 +106,7 @@ func (controller *UsersController) CooperationUserEnable() { | ||
106 | usersService := service.NewUsersService(nil) | 106 | usersService := service.NewUsersService(nil) |
107 | cooperationUserEnableCommand := &command.CooperationUserEnableCommand{} | 107 | cooperationUserEnableCommand := &command.CooperationUserEnableCommand{} |
108 | controller.Unmarshal(cooperationUserEnableCommand) | 108 | controller.Unmarshal(cooperationUserEnableCommand) |
109 | + cooperationUserEnableCommand.Operator = controller.GetOperator() | ||
109 | data, err := usersService.CooperationUserEnable(cooperationUserEnableCommand) | 110 | data, err := usersService.CooperationUserEnable(cooperationUserEnableCommand) |
110 | controller.Response(data, err) | 111 | controller.Response(data, err) |
111 | } | 112 | } |
@@ -114,6 +115,7 @@ func (controller *UsersController) CooperationUserResetPassword() { | @@ -114,6 +115,7 @@ func (controller *UsersController) CooperationUserResetPassword() { | ||
114 | usersService := service.NewUsersService(nil) | 115 | usersService := service.NewUsersService(nil) |
115 | cooperationUserResetPasswordCommand := &command.CooperationUserResetPasswordCommand{} | 116 | cooperationUserResetPasswordCommand := &command.CooperationUserResetPasswordCommand{} |
116 | controller.Unmarshal(cooperationUserResetPasswordCommand) | 117 | controller.Unmarshal(cooperationUserResetPasswordCommand) |
118 | + cooperationUserResetPasswordCommand.Operator = controller.GetOperator() | ||
117 | data, err := usersService.CooperationUserResetPassword(cooperationUserResetPasswordCommand) | 119 | data, err := usersService.CooperationUserResetPassword(cooperationUserResetPasswordCommand) |
118 | controller.Response(data, err) | 120 | controller.Response(data, err) |
119 | } | 121 | } |
pkg/port/beego/middleware/jwt.go
0 → 100644
1 | +package middleware |
-
请 注册 或 登录 后发表评论