作者 tangxuhui

更新

1 -{"F:\\go\\src\\allied-creation\\allied-creation-gateway\\pkg\\port\\beego\\routers":1627719981417605200}  
  1 +{"D:\\workspaceGo\\src\\allied-creation-gateway\\pkg\\port\\beego\\routers":1627890131470525700}
@@ -4,6 +4,7 @@ import ( @@ -4,6 +4,7 @@ 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/common/command" 5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/common/command"
6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/common/query" 6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/common/query"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic" 8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic"
8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user" 9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
9 ) 10 )
@@ -17,7 +18,7 @@ func NewCommonService(options map[string]interface{}) *CommonService { @@ -17,7 +18,7 @@ func NewCommonService(options map[string]interface{}) *CommonService {
17 18
18 //GetDictionaryByCode 根据code获取字典数据 19 //GetDictionaryByCode 根据code获取字典数据
19 func (srv *CommonService) GetDictionaryByCode(getDictionaryQuery *query.GetDictionaryByCodeQuery) (interface{}, error) { 20 func (srv *CommonService) GetDictionaryByCode(getDictionaryQuery *query.GetDictionaryByCodeQuery) (interface{}, error) {
20 - creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(0, 0, 0) 21 + creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(domain.Operator{})
21 result, err := creationBasicGateway.GetDictionarysByCode(allied_creation_basic.ReqGetDictionaryByCode{ 22 result, err := creationBasicGateway.GetDictionarysByCode(allied_creation_basic.ReqGetDictionaryByCode{
22 DictCode: getDictionaryQuery.DictCode, 23 DictCode: getDictionaryQuery.DictCode,
23 }) 24 })
@@ -33,7 +34,7 @@ func (srv *CommonService) CompanySignUp(signUpCommand *command.CompanySignUpComm @@ -33,7 +34,7 @@ func (srv *CommonService) CompanySignUp(signUpCommand *command.CompanySignUpComm
33 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 34 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
34 } 35 }
35 //校验验证码 36 //校验验证码
36 - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(0, 0, 0) 37 + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
37 _, err := creationUserGateway.AuthCompanySignUp(allied_creation_user.ReqAuthCompanySignUp{ 38 _, err := creationUserGateway.AuthCompanySignUp(allied_creation_user.ReqAuthCompanySignUp{
38 CompanyName: signUpCommand.CompanyName, 39 CompanyName: signUpCommand.CompanyName,
39 Contacts: signUpCommand.Contacts, 40 Contacts: signUpCommand.Contacts,
@@ -36,7 +36,7 @@ func (srv AuthService) AuthLogin(loginCommand *command.LoginCommand) (interface{ @@ -36,7 +36,7 @@ func (srv AuthService) AuthLogin(loginCommand *command.LoginCommand) (interface{
36 36
37 //SignInPassword 使用账号密码校验 37 //SignInPassword 使用账号密码校验
38 func (srv AuthService) SignInPassword(account string, password string) (interface{}, error) { 38 func (srv AuthService) SignInPassword(account string, password string) (interface{}, error) {
39 - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(0, 0, 0) 39 + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
40 _, err := creationUserGateway.AuthCheckPassword(allied_creation_user.ReqAuthCheckPassword{ 40 _, err := creationUserGateway.AuthCheckPassword(allied_creation_user.ReqAuthCheckPassword{
41 Password: password, 41 Password: password,
42 Phone: account, 42 Phone: account,
@@ -94,7 +94,7 @@ func (srv AuthService) GetAuthAccessToken(accessTokenCommand *command.AccessToke @@ -94,7 +94,7 @@ func (srv AuthService) GetAuthAccessToken(accessTokenCommand *command.AccessToke
94 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 94 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
95 } 95 }
96 phone := ltoken.Account 96 phone := ltoken.Account
97 - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(0, 0, 0) 97 + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
98 userSeachResult, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{ 98 userSeachResult, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{
99 Phone: phone, 99 Phone: phone,
100 }) 100 })
@@ -226,7 +226,7 @@ func (srv AuthService) RefreshAuthAccessToken(refreshTokenCommand *command.Refre @@ -226,7 +226,7 @@ func (srv AuthService) RefreshAuthAccessToken(refreshTokenCommand *command.Refre
226 return nil, application.ThrowError(application.TRANSACTION_ERROR, "refreshToken 不可用,"+err.Error()) 226 return nil, application.ThrowError(application.TRANSACTION_ERROR, "refreshToken 不可用,"+err.Error())
227 } 227 }
228 phone := ltoken.Account 228 phone := ltoken.Account
229 - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(0, 0, 0) 229 + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
230 userSeachResult, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{ 230 userSeachResult, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{
231 Phone: phone, 231 Phone: phone,
232 }) 232 })
@@ -14,9 +14,8 @@ type MenuService struct { @@ -14,9 +14,8 @@ type MenuService struct {
14 // 设置收藏菜单 14 // 设置收藏菜单
15 func (menuService *MenuService) MenuFavorite(menuFavoriteCommand *command.MenuFavoriteCommand) (interface{}, error) { 15 func (menuService *MenuService) MenuFavorite(menuFavoriteCommand *command.MenuFavoriteCommand) (interface{}, error) {
16 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 16 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
17 - menuFavoriteCommand.Operator.CompanyId,  
18 - menuFavoriteCommand.Operator.OrgId,  
19 - menuFavoriteCommand.Operator.UserId) 17 + menuFavoriteCommand.Operator,
  18 + )
20 result, err := creationUserGateway.CompanyGetCustomizeMenus(allied_creation_user.ReqCompanyGetCustomizeMenus{ 19 result, err := creationUserGateway.CompanyGetCustomizeMenus(allied_creation_user.ReqCompanyGetCustomizeMenus{
21 CompanyId: menuFavoriteCommand.Operator.CompanyId, 20 CompanyId: menuFavoriteCommand.Operator.CompanyId,
22 }) 21 })
@@ -29,9 +28,8 @@ func (menuService *MenuService) MenuFavorite(menuFavoriteCommand *command.MenuFa @@ -29,9 +28,8 @@ func (menuService *MenuService) MenuFavorite(menuFavoriteCommand *command.MenuFa
29 // 返回菜单列表 28 // 返回菜单列表
30 func (menuService *MenuService) MenuList(menuListQuery *query.MenuListQuery) (interface{}, error) { 29 func (menuService *MenuService) MenuList(menuListQuery *query.MenuListQuery) (interface{}, error) {
31 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 30 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
32 - menuListQuery.Operator.CompanyId,  
33 - menuListQuery.Operator.OrgId,  
34 - menuListQuery.Operator.UserId) 31 + menuListQuery.Operator,
  32 + )
35 result, err := creationUserGateway.CompanyGetCustomizeMenus(allied_creation_user.ReqCompanyGetCustomizeMenus{ 33 result, err := creationUserGateway.CompanyGetCustomizeMenus(allied_creation_user.ReqCompanyGetCustomizeMenus{
36 CompanyId: menuListQuery.Operator.CompanyId, 34 CompanyId: menuListQuery.Operator.CompanyId,
37 MenuCategory: menuListQuery.MenuCategory, 35 MenuCategory: menuListQuery.MenuCategory,
@@ -47,9 +45,8 @@ func (menuService *MenuService) MenuList(menuListQuery *query.MenuListQuery) (in @@ -47,9 +45,8 @@ func (menuService *MenuService) MenuList(menuListQuery *query.MenuListQuery) (in
47 // 更新自定义菜单 45 // 更新自定义菜单
48 func (menuService *MenuService) MenuUpdate(menuUpdateCommand *command.MenuUpdateCommand) (interface{}, error) { 46 func (menuService *MenuService) MenuUpdate(menuUpdateCommand *command.MenuUpdateCommand) (interface{}, error) {
49 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 47 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
50 - menuUpdateCommand.Operator.CompanyId,  
51 - menuUpdateCommand.Operator.OrgId,  
52 - menuUpdateCommand.Operator.UserId) 48 + menuUpdateCommand.Operator,
  49 + )
53 _, err := creationUserGateway.CompanySetCustomizeMenus(allied_creation_user.ReqCompanySetCustomizeMenus{ 50 _, err := creationUserGateway.CompanySetCustomizeMenus(allied_creation_user.ReqCompanySetCustomizeMenus{
54 CompanyId: menuUpdateCommand.Operator.CompanyId, 51 CompanyId: menuUpdateCommand.Operator.CompanyId,
55 MenuAlias: menuUpdateCommand.MenuAlias, 52 MenuAlias: menuUpdateCommand.MenuAlias,
@@ -19,9 +19,8 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin @@ -19,9 +19,8 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin
19 return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error()) 19 return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
20 } 20 }
21 creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic( 21 creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
22 - noticeSettingListQuery.Operator.CompanyId,  
23 - noticeSettingListQuery.Operator.OrgId,  
24 - noticeSettingListQuery.Operator.UserId) 22 + noticeSettingListQuery.Operator,
  23 + )
25 result, err := creationBasicGateway.NoticeSettingSearch(allied_creation_basic.ReqNoticeSettingSearch{ 24 result, err := creationBasicGateway.NoticeSettingSearch(allied_creation_basic.ReqNoticeSettingSearch{
26 PageIndex: noticeSettingListQuery.PageNumber, 25 PageIndex: noticeSettingListQuery.PageNumber,
27 PageSize: noticeSettingListQuery.PageSize, 26 PageSize: noticeSettingListQuery.PageSize,
@@ -39,7 +38,7 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingProfile(noticeSet @@ -39,7 +38,7 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingProfile(noticeSet
39 if err := noticeSettingProfileQuery.ValidateQuery(); err != nil { 38 if err := noticeSettingProfileQuery.ValidateQuery(); err != nil {
40 return nil, application.ThrowError(application.ARG_ERROR, err.Error()) 39 return nil, application.ThrowError(application.ARG_ERROR, err.Error())
41 } 40 }
42 - 41 + //TODO
43 return nil, nil 42 return nil, nil
44 } 43 }
45 44
@@ -49,9 +48,8 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingUpdate(noticeSett @@ -49,9 +48,8 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingUpdate(noticeSett
49 return nil, application.ThrowError(application.ARG_ERROR, err.Error()) 48 return nil, application.ThrowError(application.ARG_ERROR, err.Error())
50 } 49 }
51 creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic( 50 creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
52 - noticeSettingUpdateCommand.Operator.CompanyId,  
53 - noticeSettingUpdateCommand.Operator.OrgId,  
54 - noticeSettingUpdateCommand.Operator.UserId) 51 + noticeSettingUpdateCommand.Operator,
  52 + )
55 53
56 noticeSettingID, _ := strconv.Atoi(noticeSettingUpdateCommand.NoticeSettingId) 54 noticeSettingID, _ := strconv.Atoi(noticeSettingUpdateCommand.NoticeSettingId)
57 _, err := creationBasicGateway.NoticeSettingUpdate(allied_creation_basic.ReqNoticeSettingUpdate{ 55 _, err := creationBasicGateway.NoticeSettingUpdate(allied_creation_basic.ReqNoticeSettingUpdate{
@@ -75,9 +73,8 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingAdd(noticeSetting @@ -75,9 +73,8 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingAdd(noticeSetting
75 return nil, application.ThrowError(application.ARG_ERROR, err.Error()) 73 return nil, application.ThrowError(application.ARG_ERROR, err.Error())
76 } 74 }
77 creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic( 75 creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
78 - noticeSettingAddCommand.Operator.CompanyId,  
79 - noticeSettingAddCommand.Operator.OrgId,  
80 - noticeSettingAddCommand.Operator.UserId) 76 + noticeSettingAddCommand.Operator,
  77 + )
81 result, err := creationBasicGateway.NoticeSettingAdd(allied_creation_basic.ReqNoticeSettingAdd{ 78 result, err := creationBasicGateway.NoticeSettingAdd(allied_creation_basic.ReqNoticeSettingAdd{
82 CompanyID: int(noticeSettingAddCommand.Operator.CompanyId), 79 CompanyID: int(noticeSettingAddCommand.Operator.CompanyId),
83 Content: noticeSettingAddCommand.Content, 80 Content: noticeSettingAddCommand.Content,
@@ -17,9 +17,7 @@ type OrgsService struct { @@ -17,9 +17,7 @@ type OrgsService struct {
17 // 创建组织管理 17 // 创建组织管理
18 func (orgsService *OrgsService) OrgAdd(orgAddCommand *command.OrgAddCommand) (interface{}, error) { 18 func (orgsService *OrgsService) OrgAdd(orgAddCommand *command.OrgAddCommand) (interface{}, error) {
19 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 19 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
20 - orgAddCommand.Operator.CompanyId,  
21 - orgAddCommand.Operator.OrgId,  
22 - orgAddCommand.Operator.UserId) 20 + orgAddCommand.Operator)
23 parentId, _ := strconv.Atoi(orgAddCommand.ParentId) 21 parentId, _ := strconv.Atoi(orgAddCommand.ParentId)
24 result, err := creationUserGateway.OrgCreate(allied_creation_user.ReqOrgCreate{ 22 result, err := creationUserGateway.OrgCreate(allied_creation_user.ReqOrgCreate{
25 CompanyId: int(orgAddCommand.Operator.CompanyId), 23 CompanyId: int(orgAddCommand.Operator.CompanyId),
@@ -44,9 +42,7 @@ func (orgsService *OrgsService) OrgAdd(orgAddCommand *command.OrgAddCommand) (in @@ -44,9 +42,7 @@ func (orgsService *OrgsService) OrgAdd(orgAddCommand *command.OrgAddCommand) (in
44 // 禁用、启用组织管理 42 // 禁用、启用组织管理
45 func (orgsService *OrgsService) OrgEnable(orgEnableCommand *command.OrgEnableCommand) (interface{}, error) { 43 func (orgsService *OrgsService) OrgEnable(orgEnableCommand *command.OrgEnableCommand) (interface{}, error) {
46 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 44 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
47 - orgEnableCommand.Operator.CompanyId,  
48 - orgEnableCommand.Operator.OrgId,  
49 - orgEnableCommand.Operator.UserId) 45 + orgEnableCommand.Operator)
50 orgId, _ := strconv.Atoi(orgEnableCommand.OrgId) 46 orgId, _ := strconv.Atoi(orgEnableCommand.OrgId)
51 _, err := creationUserGateway.OrgEnable(allied_creation_user.ReqOrgEnable{ 47 _, err := creationUserGateway.OrgEnable(allied_creation_user.ReqOrgEnable{
52 OrgId: orgId, 48 OrgId: orgId,
@@ -61,9 +57,7 @@ func (orgsService *OrgsService) OrgEnable(orgEnableCommand *command.OrgEnableCom @@ -61,9 +57,7 @@ func (orgsService *OrgsService) OrgEnable(orgEnableCommand *command.OrgEnableCom
61 // 返回组织管理 57 // 返回组织管理
62 func (orgsService *OrgsService) OrgGet(orgGetQuery *query.OrgGetQuery) (interface{}, error) { 58 func (orgsService *OrgsService) OrgGet(orgGetQuery *query.OrgGetQuery) (interface{}, error) {
63 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 59 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
64 - orgGetQuery.Operator.CompanyId,  
65 - orgGetQuery.Operator.OrgId,  
66 - orgGetQuery.Operator.UserId) 60 + orgGetQuery.Operator)
67 orgId, _ := strconv.Atoi(orgGetQuery.OrgId) 61 orgId, _ := strconv.Atoi(orgGetQuery.OrgId)
68 result, err := creationUserGateway.OrgGet(allied_creation_user.ReqOrgGet{ 62 result, err := creationUserGateway.OrgGet(allied_creation_user.ReqOrgGet{
69 OrgId: orgId, 63 OrgId: orgId,
@@ -85,9 +79,7 @@ func (orgsService *OrgsService) OrgGet(orgGetQuery *query.OrgGetQuery) (interfac @@ -85,9 +79,7 @@ func (orgsService *OrgsService) OrgGet(orgGetQuery *query.OrgGetQuery) (interfac
85 // 返回组织管理列表 79 // 返回组织管理列表
86 func (orgsService *OrgsService) OrgList(orgListQuery *query.OrgListQuery) (interface{}, error) { 80 func (orgsService *OrgsService) OrgList(orgListQuery *query.OrgListQuery) (interface{}, error) {
87 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 81 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
88 - orgListQuery.Operator.CompanyId,  
89 - orgListQuery.Operator.OrgId,  
90 - orgListQuery.Operator.UserId) 82 + orgListQuery.Operator)
91 parentOrgId, _ := strconv.Atoi(orgListQuery.ParentId) 83 parentOrgId, _ := strconv.Atoi(orgListQuery.ParentId)
92 result, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{ 84 result, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{
93 CompanyId: int(orgListQuery.Operator.CompanyId), 85 CompanyId: int(orgListQuery.Operator.CompanyId),
@@ -123,9 +115,7 @@ func (orgsService *OrgsService) OrgList(orgListQuery *query.OrgListQuery) (inter @@ -123,9 +115,7 @@ func (orgsService *OrgsService) OrgList(orgListQuery *query.OrgListQuery) (inter
123 // 更新组织管理 115 // 更新组织管理
124 func (orgsService *OrgsService) OrgUpdate(orgUpdateCommand *command.OrgUpdateCommand) (interface{}, error) { 116 func (orgsService *OrgsService) OrgUpdate(orgUpdateCommand *command.OrgUpdateCommand) (interface{}, error) {
125 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 117 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
126 - orgUpdateCommand.Operator.CompanyId,  
127 - orgUpdateCommand.Operator.OrgId,  
128 - orgUpdateCommand.Operator.UserId) 118 + orgUpdateCommand.Operator)
129 parentId, _ := strconv.Atoi(orgUpdateCommand.ParentId) 119 parentId, _ := strconv.Atoi(orgUpdateCommand.ParentId)
130 orgId, _ := strconv.Atoi(orgUpdateCommand.OrgId) 120 orgId, _ := strconv.Atoi(orgUpdateCommand.OrgId)
131 _, err := creationUserGateway.OrgUpdate(allied_creation_user.ReqOrgUpdate{ 121 _, err := creationUserGateway.OrgUpdate(allied_creation_user.ReqOrgUpdate{
@@ -17,9 +17,7 @@ type RolesService struct { @@ -17,9 +17,7 @@ type RolesService struct {
17 // 创建role 17 // 创建role
18 func (rolesService *RolesService) RoleAdd(roleAddCommand *command.RoleAddCommand) (interface{}, error) { 18 func (rolesService *RolesService) RoleAdd(roleAddCommand *command.RoleAddCommand) (interface{}, error) {
19 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 19 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
20 - roleAddCommand.Operator.CompanyId,  
21 - roleAddCommand.Operator.OrgId,  
22 - roleAddCommand.Operator.UserId) 20 + roleAddCommand.Operator)
23 result, err := creationUserGateway.RoleCreate(allied_creation_user.ReqRoleCreate{ 21 result, err := creationUserGateway.RoleCreate(allied_creation_user.ReqRoleCreate{
24 RoleName: roleAddCommand.RoleName, 22 RoleName: roleAddCommand.RoleName,
25 Desc: roleAddCommand.Desc, 23 Desc: roleAddCommand.Desc,
@@ -40,9 +38,7 @@ func (rolesService *RolesService) RoleAdd(roleAddCommand *command.RoleAddCommand @@ -40,9 +38,7 @@ func (rolesService *RolesService) RoleAdd(roleAddCommand *command.RoleAddCommand
40 // 编辑role 38 // 编辑role
41 func (rolesService *RolesService) RoleEdit(roleUpdateCommand *command.RoleUpdateCommand) (interface{}, error) { 39 func (rolesService *RolesService) RoleEdit(roleUpdateCommand *command.RoleUpdateCommand) (interface{}, error) {
42 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 40 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
43 - roleUpdateCommand.Operator.CompanyId,  
44 - roleUpdateCommand.Operator.OrgId,  
45 - roleUpdateCommand.Operator.UserId) 41 + roleUpdateCommand.Operator)
46 roleId, _ := strconv.Atoi(roleUpdateCommand.RoleId) 42 roleId, _ := strconv.Atoi(roleUpdateCommand.RoleId)
47 _, err := creationUserGateway.RoleUpdate(allied_creation_user.ReqRoleUpdate{ 43 _, err := creationUserGateway.RoleUpdate(allied_creation_user.ReqRoleUpdate{
48 RoleId: int64(roleId), 44 RoleId: int64(roleId),
@@ -58,9 +54,7 @@ func (rolesService *RolesService) RoleEdit(roleUpdateCommand *command.RoleUpdate @@ -58,9 +54,7 @@ func (rolesService *RolesService) RoleEdit(roleUpdateCommand *command.RoleUpdate
58 // 返单个角色 54 // 返单个角色
59 func (rolesService *RolesService) RoleGet(roleGetQuery *query.RoleGetQuery) (interface{}, error) { 55 func (rolesService *RolesService) RoleGet(roleGetQuery *query.RoleGetQuery) (interface{}, error) {
60 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 56 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
61 - roleGetQuery.Operator.CompanyId,  
62 - roleGetQuery.Operator.OrgId,  
63 - roleGetQuery.Operator.UserId) 57 + roleGetQuery.Operator)
64 roleId, _ := strconv.Atoi(roleGetQuery.RoleId) 58 roleId, _ := strconv.Atoi(roleGetQuery.RoleId)
65 roleData, err := creationUserGateway.RoleGet(allied_creation_user.ReqRoleGet{ 59 roleData, err := creationUserGateway.RoleGet(allied_creation_user.ReqRoleGet{
66 RoleId: int64(roleId), 60 RoleId: int64(roleId),
@@ -91,9 +85,7 @@ func (rolesService *RolesService) RoleGet(roleGetQuery *query.RoleGetQuery) (int @@ -91,9 +85,7 @@ func (rolesService *RolesService) RoleGet(roleGetQuery *query.RoleGetQuery) (int
91 // 返回role列表 85 // 返回role列表
92 func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (int64, interface{}, error) { 86 func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (int64, interface{}, error) {
93 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 87 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
94 - roleListQuery.Operator.CompanyId,  
95 - roleListQuery.Operator.OrgId,  
96 - roleListQuery.Operator.UserId) 88 + roleListQuery.Operator)
97 roleList, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{ 89 roleList, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{
98 Offset: (roleListQuery.PageNumber - 1) * roleListQuery.PageSize, 90 Offset: (roleListQuery.PageNumber - 1) * roleListQuery.PageSize,
99 Limit: roleListQuery.PageSize, 91 Limit: roleListQuery.PageSize,
@@ -122,9 +114,7 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) ( @@ -122,9 +114,7 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (
122 // 编辑角色关联权限菜单的前置准备数据 114 // 编辑角色关联权限菜单的前置准备数据
123 func (rolesService *RolesService) RoleMenuBeforeEdit(roleMenuBeforeEditQuery *query.RoleMenuBeforeEditQuery) (interface{}, error) { 115 func (rolesService *RolesService) RoleMenuBeforeEdit(roleMenuBeforeEditQuery *query.RoleMenuBeforeEditQuery) (interface{}, error) {
124 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 116 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
125 - roleMenuBeforeEditQuery.Operator.CompanyId,  
126 - roleMenuBeforeEditQuery.Operator.OrgId,  
127 - roleMenuBeforeEditQuery.Operator.UserId) 117 + roleMenuBeforeEditQuery.Operator)
128 roleId, _ := strconv.Atoi(roleMenuBeforeEditQuery.RoleId) 118 roleId, _ := strconv.Atoi(roleMenuBeforeEditQuery.RoleId)
129 roles, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{ 119 roles, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{
130 OrgId: roleMenuBeforeEditQuery.Operator.OrgId, 120 OrgId: roleMenuBeforeEditQuery.Operator.OrgId,
@@ -151,9 +141,7 @@ func (rolesService *RolesService) RoleMenuBeforeEdit(roleMenuBeforeEditQuery *qu @@ -151,9 +141,7 @@ func (rolesService *RolesService) RoleMenuBeforeEdit(roleMenuBeforeEditQuery *qu
151 // 编辑角色关联用户的前置准备数据 141 // 编辑角色关联用户的前置准备数据
152 func (rolesService *RolesService) RoleUserBeforeEdit(roleUserBeforeEditQuery *query.RoleUserBeforeEditQuery) (interface{}, error) { 142 func (rolesService *RolesService) RoleUserBeforeEdit(roleUserBeforeEditQuery *query.RoleUserBeforeEditQuery) (interface{}, error) {
153 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 143 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
154 - roleUserBeforeEditQuery.Operator.CompanyId,  
155 - roleUserBeforeEditQuery.Operator.OrgId,  
156 - roleUserBeforeEditQuery.Operator.UserId) 144 + roleUserBeforeEditQuery.Operator)
157 roleId, _ := strconv.Atoi(roleUserBeforeEditQuery.RoleId) 145 roleId, _ := strconv.Atoi(roleUserBeforeEditQuery.RoleId)
158 roles, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{ 146 roles, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{
159 OrgId: roleUserBeforeEditQuery.Operator.OrgId, 147 OrgId: roleUserBeforeEditQuery.Operator.OrgId,
@@ -192,9 +180,7 @@ func (rolesService *RolesService) RoleUserBeforeEdit(roleUserBeforeEditQuery *qu @@ -192,9 +180,7 @@ func (rolesService *RolesService) RoleUserBeforeEdit(roleUserBeforeEditQuery *qu
192 // 角色编辑关联菜单权限 180 // 角色编辑关联菜单权限
193 func (rolesService *RolesService) RoleMenuEdit(roleMenuEditCommand *command.RoleMenuEditCommand) (interface{}, error) { 181 func (rolesService *RolesService) RoleMenuEdit(roleMenuEditCommand *command.RoleMenuEditCommand) (interface{}, error) {
194 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 182 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
195 - roleMenuEditCommand.Operator.CompanyId,  
196 - roleMenuEditCommand.Operator.OrgId,  
197 - roleMenuEditCommand.Operator.UserId) 183 + roleMenuEditCommand.Operator)
198 roleId, _ := strconv.Atoi(roleMenuEditCommand.RoleId) 184 roleId, _ := strconv.Atoi(roleMenuEditCommand.RoleId)
199 var menuIds []int64 185 var menuIds []int64
200 for _, v := range roleMenuEditCommand.MenuId { 186 for _, v := range roleMenuEditCommand.MenuId {
@@ -216,9 +202,7 @@ func (rolesService *RolesService) RoleMenuEdit(roleMenuEditCommand *command.Role @@ -216,9 +202,7 @@ func (rolesService *RolesService) RoleMenuEdit(roleMenuEditCommand *command.Role
216 // 移除role 202 // 移除role
217 func (rolesService *RolesService) RoleRemove(roleRemoveCommand *command.RoleRemoveCommand) (interface{}, error) { 203 func (rolesService *RolesService) RoleRemove(roleRemoveCommand *command.RoleRemoveCommand) (interface{}, error) {
218 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 204 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
219 - roleRemoveCommand.Operator.CompanyId,  
220 - roleRemoveCommand.Operator.OrgId,  
221 - roleRemoveCommand.Operator.UserId) 205 + roleRemoveCommand.Operator)
222 206
223 var roleIds []int64 207 var roleIds []int64
224 for _, v := range roleRemoveCommand.RoleIds { 208 for _, v := range roleRemoveCommand.RoleIds {
@@ -239,9 +223,7 @@ func (rolesService *RolesService) RoleRemove(roleRemoveCommand *command.RoleRemo @@ -239,9 +223,7 @@ func (rolesService *RolesService) RoleRemove(roleRemoveCommand *command.RoleRemo
239 // 角色添加关联用户 223 // 角色添加关联用户
240 func (rolesService *RolesService) RoleUserAdd(roleUserAddCommand *command.RoleUserAddCommand) (interface{}, error) { 224 func (rolesService *RolesService) RoleUserAdd(roleUserAddCommand *command.RoleUserAddCommand) (interface{}, error) {
241 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 225 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
242 - roleUserAddCommand.Operator.CompanyId,  
243 - roleUserAddCommand.Operator.OrgId,  
244 - roleUserAddCommand.Operator.UserId) 226 + roleUserAddCommand.Operator)
245 roleId, _ := strconv.Atoi(roleUserAddCommand.RoleId) 227 roleId, _ := strconv.Atoi(roleUserAddCommand.RoleId)
246 var userIds []int64 228 var userIds []int64
247 for _, v := range roleUserAddCommand.UserId { 229 for _, v := range roleUserAddCommand.UserId {
@@ -263,9 +245,7 @@ func (rolesService *RolesService) RoleUserAdd(roleUserAddCommand *command.RoleUs @@ -263,9 +245,7 @@ func (rolesService *RolesService) RoleUserAdd(roleUserAddCommand *command.RoleUs
263 // 角色添加关联用户 245 // 角色添加关联用户
264 func (rolesService *RolesService) RoleUserDelete(roleUserDeleteCommand *command.RoleUserDeleteCommand) (interface{}, error) { 246 func (rolesService *RolesService) RoleUserDelete(roleUserDeleteCommand *command.RoleUserDeleteCommand) (interface{}, error) {
265 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 247 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
266 - roleUserDeleteCommand.Operator.CompanyId,  
267 - roleUserDeleteCommand.Operator.OrgId,  
268 - roleUserDeleteCommand.Operator.UserId) 248 + roleUserDeleteCommand.Operator)
269 roleId, _ := strconv.Atoi(roleUserDeleteCommand.RoleId) 249 roleId, _ := strconv.Atoi(roleUserDeleteCommand.RoleId)
270 var userIds []int64 250 var userIds []int64
271 for _, v := range roleUserDeleteCommand.UserId { 251 for _, v := range roleUserDeleteCommand.UserId {
@@ -287,9 +267,7 @@ func (rolesService *RolesService) RoleUserDelete(roleUserDeleteCommand *command. @@ -287,9 +267,7 @@ func (rolesService *RolesService) RoleUserDelete(roleUserDeleteCommand *command.
287 // 角色下关联用户的数据 (暂时不需要这个) 267 // 角色下关联用户的数据 (暂时不需要这个)
288 func (rolesService *RolesService) RoleUserInfo(roleUserInfoQuery *query.RoleUserInfoQuery) (interface{}, error) { 268 func (rolesService *RolesService) RoleUserInfo(roleUserInfoQuery *query.RoleUserInfoQuery) (interface{}, error) {
289 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 269 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
290 - roleUserInfoQuery.Operator.CompanyId,  
291 - roleUserInfoQuery.Operator.OrgId,  
292 - roleUserInfoQuery.Operator.UserId) 270 + roleUserInfoQuery.Operator)
293 relatedUser, err := creationUserGateway.RoleGetRelatedUser(allied_creation_user.ReqRoleGetRelatedUser{ 271 relatedUser, err := creationUserGateway.RoleGetRelatedUser(allied_creation_user.ReqRoleGetRelatedUser{
294 RoleId: roleUserInfoQuery.RoleId, 272 RoleId: roleUserInfoQuery.RoleId,
295 }) 273 })
@@ -8,6 +8,7 @@ import ( @@ -8,6 +8,7 @@ import (
8 "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"
9 "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"
10 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/query" 10 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/query"
  11 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
11 12
12 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user" 13 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
13 ) 14 )
@@ -24,9 +25,7 @@ func NewUsersService(options map[string]interface{}) *UsersService { @@ -24,9 +25,7 @@ func NewUsersService(options map[string]interface{}) *UsersService {
24 // 获取公司用户信息 25 // 获取公司用户信息
25 func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.CompanyUserGetQuery) (interface{}, error) { 26 func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.CompanyUserGetQuery) (interface{}, error) {
26 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 27 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
27 - companyUserGetQuery.Operator.CompanyId,  
28 - companyUserGetQuery.Operator.OrgId,  
29 - companyUserGetQuery.Operator.UserId) 28 + companyUserGetQuery.Operator)
30 userid, _ := strconv.Atoi(companyUserGetQuery.UsersId) 29 userid, _ := strconv.Atoi(companyUserGetQuery.UsersId)
31 resultUser, err := creationUserGateway.UserGet(allied_creation_user.ReqGateUser{ 30 resultUser, err := creationUserGateway.UserGet(allied_creation_user.ReqGateUser{
32 UserId: userid, 31 UserId: userid,
@@ -96,9 +95,7 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp @@ -96,9 +95,7 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp
96 // 创建公司用户信息 95 // 创建公司用户信息
97 func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command.CompanyUserAddCommand) (interface{}, error) { 96 func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command.CompanyUserAddCommand) (interface{}, error) {
98 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 97 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
99 - companyUserAddCommand.Operator.CompanyId,  
100 - companyUserAddCommand.Operator.OrgId,  
101 - companyUserAddCommand.Operator.UserId) 98 + companyUserAddCommand.Operator)
102 departmentId, _ := strconv.Atoi(companyUserAddCommand.OrgId) 99 departmentId, _ := strconv.Atoi(companyUserAddCommand.OrgId)
103 orgId, _ := strconv.Atoi(companyUserAddCommand.OrgId) 100 orgId, _ := strconv.Atoi(companyUserAddCommand.OrgId)
104 userOrg := []int64{} 101 userOrg := []int64{}
@@ -146,9 +143,7 @@ func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command. @@ -146,9 +143,7 @@ func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command.
146 // 启用禁用公司用户信息 143 // 启用禁用公司用户信息
147 func (usersService *UsersService) CompanyUserEnable(companyUserEnableCommand *command.CompanyUserEnableCommand) (interface{}, error) { 144 func (usersService *UsersService) CompanyUserEnable(companyUserEnableCommand *command.CompanyUserEnableCommand) (interface{}, error) {
148 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 145 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
149 - companyUserEnableCommand.Operator.CompanyId,  
150 - companyUserEnableCommand.Operator.OrgId,  
151 - companyUserEnableCommand.Operator.UserId) 146 + companyUserEnableCommand.Operator)
152 147
153 var userIds []int64 148 var userIds []int64
154 for i := range companyUserEnableCommand.UsersIds { 149 for i := range companyUserEnableCommand.UsersIds {
@@ -167,7 +162,7 @@ func (usersService *UsersService) CompanyUserEnable(companyUserEnableCommand *co @@ -167,7 +162,7 @@ func (usersService *UsersService) CompanyUserEnable(companyUserEnableCommand *co
167 162
168 // 返回公司用户信息列表 163 // 返回公司用户信息列表
169 func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.CompanyUserListQuery) (int64, interface{}, error) { 164 func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.CompanyUserListQuery) (int64, interface{}, error) {
170 - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(0, 0, 0) 165 + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
171 result, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{ 166 result, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{
172 Offset: (companyUserListQuery.PageNumber - 1) * companyUserListQuery.PageSize, 167 Offset: (companyUserListQuery.PageNumber - 1) * companyUserListQuery.PageSize,
173 Limit: companyUserListQuery.PageSize, 168 Limit: companyUserListQuery.PageSize,
@@ -206,9 +201,7 @@ func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.Co @@ -206,9 +201,7 @@ func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.Co
206 // 批量重置密码 201 // 批量重置密码
207 func (usersService *UsersService) CompanyUserResetPassword(companyUserResetPasswordCommand *command.CompanyUserResetPasswordCommand) (interface{}, error) { 202 func (usersService *UsersService) CompanyUserResetPassword(companyUserResetPasswordCommand *command.CompanyUserResetPasswordCommand) (interface{}, error) {
208 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 203 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
209 - companyUserResetPasswordCommand.Operator.CompanyId,  
210 - companyUserResetPasswordCommand.Operator.OrgId,  
211 - companyUserResetPasswordCommand.Operator.UserId) 204 + companyUserResetPasswordCommand.Operator)
212 var userIds []int64 205 var userIds []int64
213 for i := range companyUserResetPasswordCommand.UserIds { 206 for i := range companyUserResetPasswordCommand.UserIds {
214 id, _ := strconv.Atoi(companyUserResetPasswordCommand.UserIds[i]) 207 id, _ := strconv.Atoi(companyUserResetPasswordCommand.UserIds[i])
@@ -227,9 +220,7 @@ func (usersService *UsersService) CompanyUserResetPassword(companyUserResetPassw @@ -227,9 +220,7 @@ func (usersService *UsersService) CompanyUserResetPassword(companyUserResetPassw
227 // 更新公司用户信息 220 // 更新公司用户信息
228 func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *command.CompanyUserUpdateCommand) (interface{}, error) { 221 func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *command.CompanyUserUpdateCommand) (interface{}, error) {
229 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 222 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
230 - companyUserUpdateCommand.Operator.CompanyId,  
231 - companyUserUpdateCommand.Operator.OrgId,  
232 - companyUserUpdateCommand.Operator.UserId) 223 + companyUserUpdateCommand.Operator)
233 departmentId, _ := strconv.Atoi(companyUserUpdateCommand.OrganizationId) 224 departmentId, _ := strconv.Atoi(companyUserUpdateCommand.OrganizationId)
234 orgId, _ := strconv.Atoi(companyUserUpdateCommand.OrganizationId) 225 orgId, _ := strconv.Atoi(companyUserUpdateCommand.OrganizationId)
235 userOrg := []int64{} 226 userOrg := []int64{}
@@ -270,9 +261,7 @@ func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *co @@ -270,9 +261,7 @@ func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *co
270 // 创建共创用户信息 261 // 创建共创用户信息
271 func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand *command.CooperationUserAddCommand) (interface{}, error) { 262 func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand *command.CooperationUserAddCommand) (interface{}, error) {
272 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 263 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
273 - cooperationUserAddCommand.Operator.CompanyId,  
274 - cooperationUserAddCommand.Operator.OrgId,  
275 - cooperationUserAddCommand.Operator.UserId) 264 + cooperationUserAddCommand.Operator)
276 result, err := creationUserGateway.CooperatorUserCreate(allied_creation_user.ReqCreateCooperatorUser{ 265 result, err := creationUserGateway.CooperatorUserCreate(allied_creation_user.ReqCreateCooperatorUser{
277 CompanyId: cooperationUserAddCommand.Operator.CompanyId, 266 CompanyId: cooperationUserAddCommand.Operator.CompanyId,
278 CooperationCompany: cooperationUserAddCommand.CooperationCompany, 267 CooperationCompany: cooperationUserAddCommand.CooperationCompany,
@@ -302,9 +291,7 @@ func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand * @@ -302,9 +291,7 @@ func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand *
302 // 启用禁用共创用户信息 291 // 启用禁用共创用户信息
303 func (usersService *UsersService) CooperationUserEnable(cooperationUserEnableCommand *command.CooperationUserEnableCommand) (interface{}, error) { 292 func (usersService *UsersService) CooperationUserEnable(cooperationUserEnableCommand *command.CooperationUserEnableCommand) (interface{}, error) {
304 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 293 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
305 - cooperationUserEnableCommand.Operator.CompanyId,  
306 - cooperationUserEnableCommand.Operator.OrgId,  
307 - cooperationUserEnableCommand.Operator.UserId) 294 + cooperationUserEnableCommand.Operator)
308 var userIds []int64 295 var userIds []int64
309 for i := range cooperationUserEnableCommand.UsersIds { 296 for i := range cooperationUserEnableCommand.UsersIds {
310 id, _ := strconv.Atoi(cooperationUserEnableCommand.UsersIds[i]) 297 id, _ := strconv.Atoi(cooperationUserEnableCommand.UsersIds[i])
@@ -323,9 +310,7 @@ func (usersService *UsersService) CooperationUserEnable(cooperationUserEnableCom @@ -323,9 +310,7 @@ func (usersService *UsersService) CooperationUserEnable(cooperationUserEnableCom
323 // 获取共创用户信息 310 // 获取共创用户信息
324 func (usersService *UsersService) CooperationUserGet(cooperationUserGetQuery *query.CooperationUserGetQuery) (interface{}, error) { 311 func (usersService *UsersService) CooperationUserGet(cooperationUserGetQuery *query.CooperationUserGetQuery) (interface{}, error) {
325 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 312 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
326 - cooperationUserGetQuery.Operator.CompanyId,  
327 - cooperationUserGetQuery.Operator.OrgId,  
328 - cooperationUserGetQuery.Operator.UserId) 313 + cooperationUserGetQuery.Operator)
329 userId, _ := strconv.Atoi(cooperationUserGetQuery.UserId) 314 userId, _ := strconv.Atoi(cooperationUserGetQuery.UserId)
330 result, err := creationUserGateway.UserGet(allied_creation_user.ReqGateUser{ 315 result, err := creationUserGateway.UserGet(allied_creation_user.ReqGateUser{
331 UserId: userId, 316 UserId: userId,
@@ -350,7 +335,7 @@ func (usersService *UsersService) CooperationUserGet(cooperationUserGetQuery *qu @@ -350,7 +335,7 @@ func (usersService *UsersService) CooperationUserGet(cooperationUserGetQuery *qu
350 335
351 // 返回共创用户信息列表 336 // 返回共创用户信息列表
352 func (usersService *UsersService) CooperationUserList(cooperationUserListQuery *query.CooperationUserListQuery) (int64, interface{}, error) { 337 func (usersService *UsersService) CooperationUserList(cooperationUserListQuery *query.CooperationUserListQuery) (int64, interface{}, error) {
353 - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(0, 0, 0) 338 + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
354 result, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{ 339 result, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{
355 Offset: (cooperationUserListQuery.PageNumber - 1) * cooperationUserListQuery.PageSize, 340 Offset: (cooperationUserListQuery.PageNumber - 1) * cooperationUserListQuery.PageSize,
356 Limit: cooperationUserListQuery.PageSize, 341 Limit: cooperationUserListQuery.PageSize,
@@ -388,9 +373,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery * @@ -388,9 +373,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery *
388 // 批量重置密码 373 // 批量重置密码
389 func (usersService *UsersService) CooperationUserResetPassword(cooperationUserResetPasswordCommand *command.CooperationUserResetPasswordCommand) (interface{}, error) { 374 func (usersService *UsersService) CooperationUserResetPassword(cooperationUserResetPasswordCommand *command.CooperationUserResetPasswordCommand) (interface{}, error) {
390 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 375 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
391 - cooperationUserResetPasswordCommand.Operator.CompanyId,  
392 - cooperationUserResetPasswordCommand.Operator.OrgId,  
393 - cooperationUserResetPasswordCommand.Operator.UserId) 376 + cooperationUserResetPasswordCommand.Operator)
394 var userIds []int64 377 var userIds []int64
395 for i := range cooperationUserResetPasswordCommand.UserIds { 378 for i := range cooperationUserResetPasswordCommand.UserIds {
396 id, _ := strconv.Atoi(cooperationUserResetPasswordCommand.UserIds[i]) 379 id, _ := strconv.Atoi(cooperationUserResetPasswordCommand.UserIds[i])
@@ -410,9 +393,7 @@ func (usersService *UsersService) CooperationUserResetPassword(cooperationUserRe @@ -410,9 +393,7 @@ func (usersService *UsersService) CooperationUserResetPassword(cooperationUserRe
410 // 编辑共创用户信息 393 // 编辑共创用户信息
411 func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCommand *command.CooperationUserUpdateCommand) (interface{}, error) { 394 func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCommand *command.CooperationUserUpdateCommand) (interface{}, error) {
412 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 395 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
413 - cooperationUserUpdateCommand.Operator.CompanyId,  
414 - cooperationUserUpdateCommand.Operator.OrgId,  
415 - cooperationUserUpdateCommand.Operator.UserId) 396 + cooperationUserUpdateCommand.Operator)
416 _, err := creationUserGateway.CooperatorUserUpdate(allied_creation_user.ReqUpdateCooperatorUser{ 397 _, err := creationUserGateway.CooperatorUserUpdate(allied_creation_user.ReqUpdateCooperatorUser{
417 UserId: cooperationUserUpdateCommand.UserId, 398 UserId: cooperationUserUpdateCommand.UserId,
418 CooperationCompany: cooperationUserUpdateCommand.CooperationCompany, 399 CooperationCompany: cooperationUserUpdateCommand.CooperationCompany,
@@ -434,9 +415,7 @@ func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCom @@ -434,9 +415,7 @@ func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCom
434 //CompanyOrgSelector 获取公司组织的下拉列表 415 //CompanyOrgSelector 获取公司组织的下拉列表
435 func (usersService *UsersService) SelectorCompanyOrg(selectorQuery *query.CompanyOrgSelectorQuery) (int64, interface{}, error) { 416 func (usersService *UsersService) SelectorCompanyOrg(selectorQuery *query.CompanyOrgSelectorQuery) (int64, interface{}, error) {
436 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 417 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
437 - selectorQuery.Operator.CompanyId,  
438 - selectorQuery.Operator.OrgId,  
439 - selectorQuery.Operator.UserId) 418 + selectorQuery.Operator)
440 result, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{ 419 result, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{
441 CompanyId: int(selectorQuery.Operator.CompanyId), 420 CompanyId: int(selectorQuery.Operator.CompanyId),
442 DepName: selectorQuery.OrgName, 421 DepName: selectorQuery.OrgName,
@@ -468,9 +447,7 @@ func (usersService *UsersService) SelectorCompanyOrg(selectorQuery *query.Compan @@ -468,9 +447,7 @@ func (usersService *UsersService) SelectorCompanyOrg(selectorQuery *query.Compan
468 //SelectorCompanyRole 获取公司角色的下拉列表 447 //SelectorCompanyRole 获取公司角色的下拉列表
469 func (usersService *UsersService) SelectorCompanyRole(selectorQuery *query.CompanyRoleSelectorQuery) (int64, interface{}, error) { 448 func (usersService *UsersService) SelectorCompanyRole(selectorQuery *query.CompanyRoleSelectorQuery) (int64, interface{}, error) {
470 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 449 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
471 - selectorQuery.Operator.CompanyId,  
472 - selectorQuery.Operator.OrgId,  
473 - selectorQuery.Operator.UserId) 450 + selectorQuery.Operator)
474 result, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{ 451 result, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{
475 Limit: selectorQuery.PageSize, 452 Limit: selectorQuery.PageSize,
476 Offset: (selectorQuery.PageNumber - 1) * selectorQuery.PageSize, 453 Offset: (selectorQuery.PageNumber - 1) * selectorQuery.PageSize,
@@ -498,9 +475,7 @@ func (usersService *UsersService) SelectorCompanyRole(selectorQuery *query.Compa @@ -498,9 +475,7 @@ func (usersService *UsersService) SelectorCompanyRole(selectorQuery *query.Compa
498 //CompanyOrgSelector 获取公司全组织部门的下拉列表 475 //CompanyOrgSelector 获取公司全组织部门的下拉列表
499 func (usersService *UsersService) SelectorCompanyOrgAll(selectorQuery *query.CompanyOrgSelectorQuery) (int64, interface{}, error) { 476 func (usersService *UsersService) SelectorCompanyOrgAll(selectorQuery *query.CompanyOrgSelectorQuery) (int64, interface{}, error) {
500 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 477 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
501 - selectorQuery.Operator.CompanyId,  
502 - selectorQuery.Operator.OrgId,  
503 - selectorQuery.Operator.UserId) 478 + selectorQuery.Operator)
504 result, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{ 479 result, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{
505 CompanyId: int(selectorQuery.Operator.CompanyId), 480 CompanyId: int(selectorQuery.Operator.CompanyId),
506 DepName: "", 481 DepName: "",
@@ -3,9 +3,9 @@ package allied_creation_basic @@ -3,9 +3,9 @@ package allied_creation_basic
3 import ( 3 import (
4 "time" 4 "time"
5 5
6 - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"  
7 -  
8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant" 6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
9 ) 9 )
10 10
11 type HttplibAlliedCreationBasic struct { 11 type HttplibAlliedCreationBasic struct {
@@ -13,14 +13,15 @@ type HttplibAlliedCreationBasic struct { @@ -13,14 +13,15 @@ type HttplibAlliedCreationBasic struct {
13 baseUrL string 13 baseUrL string
14 } 14 }
15 15
16 -func NewHttplibAlliedCreationBasic(companyId int64, orgId int64, userId int64) *HttplibAlliedCreationBasic { 16 +func NewHttplibAlliedCreationBasic(operator domain.Operator) *HttplibAlliedCreationBasic {
17 return &HttplibAlliedCreationBasic{ 17 return &HttplibAlliedCreationBasic{
18 BaseServiceGateway: service_gateway.BaseServiceGateway{ 18 BaseServiceGateway: service_gateway.BaseServiceGateway{
19 ConnectTimeout: 100 * time.Second, 19 ConnectTimeout: 100 * time.Second,
20 ReadWriteTimeout: 30 * time.Second, 20 ReadWriteTimeout: 30 * time.Second,
21 - CompanyId: companyId,  
22 - OrgId: orgId,  
23 - UserId: userId, 21 + CompanyId: operator.CompanyId,
  22 + OrgId: operator.OrgId,
  23 + UserId: operator.UserId,
  24 + UserBaseId: operator.UserBaseId,
24 }, 25 },
25 baseUrL: constant.ALLIED_CREATION_USER_HOST, 26 baseUrL: constant.ALLIED_CREATION_USER_HOST,
26 } 27 }
@@ -11,7 +11,7 @@ import ( @@ -11,7 +11,7 @@ import (
11 11
12 // NoticeSettingUpdate 更新消息模板 12 // NoticeSettingUpdate 更新消息模板
13 func (gateway HttplibAlliedCreationBasic) NoticeSettingUpdate(param ReqNoticeSettingUpdate) (*DataNoticeSettingUpdate, error) { 13 func (gateway HttplibAlliedCreationBasic) NoticeSettingUpdate(param ReqNoticeSettingUpdate) (*DataNoticeSettingUpdate, error) {
14 - url := gateway.baseUrL + "/notice-setting" 14 + url := gateway.baseUrL + "/notice-setting" + strconv.Itoa(param.NoticeSettingID)
15 method := "PUT" 15 method := "PUT"
16 req := gateway.CreateRequest(url, method) 16 req := gateway.CreateRequest(url, method)
17 log.Logger.Debug("向基础模块请求数据:更新消息模板。", map[string]interface{}{ 17 log.Logger.Debug("向基础模块请求数据:更新消息模板。", map[string]interface{}{
@@ -4,6 +4,7 @@ import ( @@ -4,6 +4,7 @@ import (
4 "time" 4 "time"
5 5
6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant" 6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
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 ) 9 )
9 10
@@ -13,14 +14,15 @@ type HttplibAlliedCreationUser struct { @@ -13,14 +14,15 @@ type HttplibAlliedCreationUser struct {
13 baseUrL string 14 baseUrL string
14 } 15 }
15 16
16 -func NewHttplibAlliedCreationUser(companyId int64, orgId int64, userId int64) *HttplibAlliedCreationUser { 17 +func NewHttplibAlliedCreationUser(operator domain.Operator) *HttplibAlliedCreationUser {
17 return &HttplibAlliedCreationUser{ 18 return &HttplibAlliedCreationUser{
18 BaseServiceGateway: service_gateway.BaseServiceGateway{ 19 BaseServiceGateway: service_gateway.BaseServiceGateway{
19 ConnectTimeout: 100 * time.Second, 20 ConnectTimeout: 100 * time.Second,
20 ReadWriteTimeout: 30 * time.Second, 21 ReadWriteTimeout: 30 * time.Second,
21 - CompanyId: companyId,  
22 - OrgId: orgId,  
23 - UserId: userId, 22 + CompanyId: operator.CompanyId,
  23 + OrgId: operator.OrgId,
  24 + UserId: operator.UserId,
  25 + UserBaseId: operator.UserBaseId,
24 }, 26 },
25 baseUrL: constant.ALLIED_CREATION_USER_HOST, 27 baseUrL: constant.ALLIED_CREATION_USER_HOST,
26 } 28 }
@@ -26,6 +26,7 @@ type BaseServiceGateway struct { @@ -26,6 +26,7 @@ type BaseServiceGateway struct {
26 CompanyId int64 26 CompanyId int64
27 OrgId int64 27 OrgId int64
28 UserId int64 28 UserId int64
  29 + UserBaseId int64
29 } 30 }
30 31
31 func (gateway BaseServiceGateway) CreateRequest(url string, method string) *httplib.BeegoHTTPRequest { 32 func (gateway BaseServiceGateway) CreateRequest(url string, method string) *httplib.BeegoHTTPRequest {