作者 tangxuhui
@@ -23,6 +23,13 @@ func (srv AuthService) AuthLogin(loginCommand *command.LoginCommand) (interface{ @@ -23,6 +23,13 @@ func (srv AuthService) AuthLogin(loginCommand *command.LoginCommand) (interface{
23 result interface{} 23 result interface{}
24 err error 24 err error
25 ) 25 )
  26 + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
  27 + _, err = creationUserGateway.AuthRefreshIM(allied_creation_user.ReqAuthRefreshIM{
  28 + Phone: loginCommand.Phone,
  29 + })
  30 + if err != nil {
  31 + return nil, application.ThrowError(application.TRANSACTION_ERROR, "系统错误")
  32 + }
26 switch loginCommand.GrantType { 33 switch loginCommand.GrantType {
27 case "signInPassword": 34 case "signInPassword":
28 result, err = srv.SignInPassword(loginCommand.Phone, loginCommand.Password) 35 result, err = srv.SignInPassword(loginCommand.Phone, loginCommand.Password)
@@ -88,7 +95,7 @@ func (srv AuthService) GetAuthAccessToken(accessTokenCommand *command.AccessToke @@ -88,7 +95,7 @@ func (srv AuthService) GetAuthAccessToken(accessTokenCommand *command.AccessToke
88 if err := accessTokenCommand.ValidateCommand(); err != nil { 95 if err := accessTokenCommand.ValidateCommand(); err != nil {
89 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 96 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
90 } 97 }
91 - ltoken := domain.LoginToken{} 98 + ltoken := &domain.LoginToken{}
92 err := ltoken.ParseToken(accessTokenCommand.AuthCode) 99 err := ltoken.ParseToken(accessTokenCommand.AuthCode)
93 if err != nil { 100 if err != nil {
94 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 101 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -96,6 +103,7 @@ func (srv AuthService) GetAuthAccessToken(accessTokenCommand *command.AccessToke @@ -96,6 +103,7 @@ func (srv AuthService) GetAuthAccessToken(accessTokenCommand *command.AccessToke
96 phone := ltoken.Account 103 phone := ltoken.Account
97 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{}) 104 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
98 userSeachResult, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{ 105 userSeachResult, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{
  106 + CompanyId: ltoken.CompanyId,
99 Phone: phone, 107 Phone: phone,
100 }) 108 })
101 if err != nil { 109 if err != nil {
@@ -137,7 +145,7 @@ func (srv AuthService) GetAuthAccessToken(accessTokenCommand *command.AccessToke @@ -137,7 +145,7 @@ func (srv AuthService) GetAuthAccessToken(accessTokenCommand *command.AccessToke
137 UserId: int64(userSeachResult.Users[0].UserId), 145 UserId: int64(userSeachResult.Users[0].UserId),
138 Account: userSeachResult.Users[0].UserInfo.Phone, 146 Account: userSeachResult.Users[0].UserInfo.Phone,
139 Platform: domain.LoginPlatformApp, 147 Platform: domain.LoginPlatformApp,
140 - CompanyId: int64(userSeachResult.Users[0].Company.CompanyId), 148 + //CompanyId: int64(userSeachResult.Users[0].Company.CompanyId),
141 OrganizationId: int64(userSeachResult.Users[0].Org.OrgId), 149 OrganizationId: int64(userSeachResult.Users[0].Org.OrgId),
142 AccessToken: "", 150 AccessToken: "",
143 RefreshToken: "", 151 RefreshToken: "",
@@ -146,6 +154,9 @@ func (srv AuthService) GetAuthAccessToken(accessTokenCommand *command.AccessToke @@ -146,6 +154,9 @@ func (srv AuthService) GetAuthAccessToken(accessTokenCommand *command.AccessToke
146 CreatedTime: time.Now(), 154 CreatedTime: time.Now(),
147 UpdatedTime: time.Now(), 155 UpdatedTime: time.Now(),
148 } 156 }
  157 + if userSeachResult.Users[0].Company != nil {
  158 + currentAccess.CompanyId = int64(userSeachResult.Users[0].Company.CompanyId)
  159 + }
149 } 160 }
150 //判定当前凭证的companyId,OrganizationId 是否在用户列表中 161 //判定当前凭证的companyId,OrganizationId 是否在用户列表中
151 var currentOrgIsOK bool 162 var currentOrgIsOK bool
@@ -343,6 +354,8 @@ func (srv AuthService) GetUserInfo(userInfoCommand *command.UserInfoCommand) (in @@ -343,6 +354,8 @@ func (srv AuthService) GetUserInfo(userInfoCommand *command.UserInfoCommand) (in
343 "userName": resultUser.UserInfo.UserName, 354 "userName": resultUser.UserInfo.UserName,
344 "userPhone": resultUser.UserInfo.Phone, 355 "userPhone": resultUser.UserInfo.Phone,
345 "userAvatar": resultUser.UserInfo.Avatar, 356 "userAvatar": resultUser.UserInfo.Avatar,
  357 + //"userCode": resultUser.UserInfo.UserCode,
  358 + "email": resultUser.UserInfo.Email,
346 }, 359 },
347 "department": resultUser.Department, 360 "department": resultUser.Department,
348 "company": map[string]interface{}{ 361 "company": map[string]interface{}{
@@ -3,7 +3,9 @@ package service @@ -3,7 +3,9 @@ package service
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/mobile/cooperation/command" 5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
6 "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 + "strconv"
7 ) 9 )
8 10
9 // CooperationProjectService 共创项目服务 11 // CooperationProjectService 共创项目服务
@@ -11,18 +13,31 @@ type CooperationProjectService struct { @@ -11,18 +13,31 @@ type CooperationProjectService struct {
11 } 13 }
12 14
13 // CreateCooperationProject TODO:创建共创项目 15 // CreateCooperationProject TODO:创建共创项目
14 -func (srv CooperationProjectService) CreateCooperationProject(userMenusCommand *command.CreateCooperationProjectCommand) (interface{}, error) {  
15 - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(  
16 - userMenusCommand.Operator)  
17 - resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{  
18 - UserId: int(userMenusCommand.Operator.UserId), 16 +func (srv CooperationProjectService) CreateCooperationProject(createCooperationProjectCommand *command.CreateCooperationProjectCommand) (interface{}, error) {
  17 + if err := createCooperationProjectCommand.ValidateCommand(); err != nil {
  18 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  19 + }
  20 + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator)
  21 + result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{
  22 + CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription,
  23 + CooperationProjectName: createCooperationProjectCommand.CooperationProjectName,
  24 + PublisherUid: strconv.Itoa(int(createCooperationProjectCommand.Operator.UserId)),
  25 + SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor,
  26 + CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType,
  27 + Images: createCooperationProjectCommand.Images,
19 }) 28 })
  29 +
20 if err != nil { 30 if err != nil {
21 - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 31 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
22 } 32 }
23 - return map[string]interface{}{  
24 - "accessMenus": resultMenu.Menus,  
25 - }, nil 33 + data := struct {
  34 + CooperationProjectId int `json:"cooperationProjectId"`
  35 + command.CreateCooperationProjectCommand
  36 + }{
  37 + CooperationProjectId: result.CooperationProjectId,
  38 + CreateCooperationProjectCommand: *createCooperationProjectCommand,
  39 + }
  40 + return data, nil
26 } 41 }
27 42
28 // GetCooperationProject TODO:返回共创项目明细 43 // GetCooperationProject TODO:返回共创项目明细
@@ -13,7 +13,7 @@ type Department struct { @@ -13,7 +13,7 @@ type Department struct {
13 } 13 }
14 type User struct { 14 type User struct {
15 UserID int `json:"userId"` 15 UserID int `json:"userId"`
16 - UserName string `json:"userName"` 16 + UserInfo map[string]interface{} `json:"userInfo"`
17 } 17 }
18 18
19 func (dto *DepartmentUsersDto) LoadDto(subDepartment *allied_creation_user.DataOrgGetSubDepartment, userSearch *allied_creation_user.DataUserSearch) error { 19 func (dto *DepartmentUsersDto) LoadDto(subDepartment *allied_creation_user.DataOrgGetSubDepartment, userSearch *allied_creation_user.DataUserSearch) error {
@@ -38,7 +38,9 @@ func (dto *DepartmentUsersDto) LoadDto(subDepartment *allied_creation_user.DataO @@ -38,7 +38,9 @@ func (dto *DepartmentUsersDto) LoadDto(subDepartment *allied_creation_user.DataO
38 if v, ok := mapDepartment[int64(user.Department.DepartmentId)]; ok { 38 if v, ok := mapDepartment[int64(user.Department.DepartmentId)]; ok {
39 v.Users = append(v.Users, User{ 39 v.Users = append(v.Users, User{
40 UserID: user.UserId, 40 UserID: user.UserId,
41 - UserName: user.UserInfo.UserName, 41 + UserInfo: map[string]interface{}{
  42 + "userName": user.UserInfo.UserName,
  43 + },
42 }) 44 })
43 } 45 }
44 } 46 }
@@ -25,9 +25,9 @@ type CompanyUserAddCommand struct { @@ -25,9 +25,9 @@ type CompanyUserAddCommand struct {
25 // 邮箱 25 // 邮箱
26 Email string `json:"email" valid:"Required"` 26 Email string `json:"email" valid:"Required"`
27 // 关联的组织机构 27 // 关联的组织机构
28 - UsersOrg []string `json:"userOrg"`  
29 - // 关联的用户  
30 - UsersRole []string `json:"userRole"` 28 + UserOrg []Org `json:"userOrg,omitempty"`
  29 + // 关联的组织结构
  30 + UserRole []Role `json:"userRole,omitempty"`
31 // 头像 31 // 头像
32 Avatar string `json:"avatar" valid:"Required"` 32 Avatar string `json:"avatar" valid:"Required"`
33 } 33 }
@@ -102,14 +102,14 @@ func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command. @@ -102,14 +102,14 @@ func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command.
102 orgId, _ := strconv.Atoi(companyUserAddCommand.OrgId) 102 orgId, _ := strconv.Atoi(companyUserAddCommand.OrgId)
103 userOrg := []int64{} 103 userOrg := []int64{}
104 userRole := []int64{} 104 userRole := []int64{}
105 - for _, v := range companyUserAddCommand.UsersOrg {  
106 - id, err := strconv.Atoi(v) 105 + for _, v := range companyUserAddCommand.UserOrg {
  106 + id, err := strconv.Atoi(v.OrgId)
107 if err == nil { 107 if err == nil {
108 userOrg = append(userOrg, int64(id)) 108 userOrg = append(userOrg, int64(id))
109 } 109 }
110 } 110 }
111 - for _, v := range companyUserAddCommand.UsersRole {  
112 - id, err := strconv.Atoi(v) 111 + for _, v := range companyUserAddCommand.UserRole {
  112 + id, err := strconv.Atoi(v.RoleId)
113 if err == nil { 113 if err == nil {
114 userRole = append(userRole, int64(id)) 114 userRole = append(userRole, int64(id))
115 } 115 }
@@ -128,7 +128,7 @@ func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command. @@ -128,7 +128,7 @@ func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command.
128 UserName: companyUserAddCommand.UsersName, 128 UserName: companyUserAddCommand.UsersName,
129 Phone: companyUserAddCommand.Phone, 129 Phone: companyUserAddCommand.Phone,
130 Avatar: companyUserAddCommand.Avatar, 130 Avatar: companyUserAddCommand.Avatar,
131 - Email: companyUserAddCommand.Avatar, 131 + Email: companyUserAddCommand.Email,
132 Password: "123456", //TODO 填充密码 132 Password: "123456", //TODO 填充密码
133 }) 133 })
134 if err != nil { 134 if err != nil {
@@ -13,7 +13,7 @@ var ALLIED_CREATION_BASIC_HOST = "http://localhost:8080" @@ -13,7 +13,7 @@ var ALLIED_CREATION_BASIC_HOST = "http://localhost:8080"
13 var ALLIED_CREATION_USER_HOST = "http://localhost:8081" 13 var ALLIED_CREATION_USER_HOST = "http://localhost:8081"
14 14
15 //天联共创业务模块 15 //天联共创业务模块
16 -var ALLIED_CREATION_COOPERATION_HOST = "http://localhost:8081" 16 +var ALLIED_CREATION_COOPERATION_HOST = "http://localhost:8082"
17 17
18 //通用模块短信服务 18 //通用模块短信服务
19 var SMS_SERVE_HOST = "http://localhost:8081" 19 var SMS_SERVE_HOST = "http://localhost:8081"
@@ -53,24 +53,23 @@ func (t *LoginToken) GenerateRefreshToken() (string, error) { @@ -53,24 +53,23 @@ func (t *LoginToken) GenerateRefreshToken() (string, error) {
53 53
54 func (t *LoginToken) GenerateAuthCode() (string, error) { 54 func (t *LoginToken) GenerateAuthCode() (string, error) {
55 nowTime := time.Now().Unix() 55 nowTime := time.Now().Unix()
56 - claims := LoginToken{  
57 - StandardClaims: jwt.StandardClaims{ 56 + t.StandardClaims = jwt.StandardClaims{
58 NotBefore: nowTime, 57 NotBefore: nowTime,
59 IssuedAt: nowTime, 58 IssuedAt: nowTime,
60 ExpiresAt: nowTime + authCodeExpire, 59 ExpiresAt: nowTime + authCodeExpire,
61 Issuer: "allied_creation_gateway", 60 Issuer: "allied_creation_gateway",
62 - },  
63 } 61 }
64 - token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) 62 +
  63 + token := jwt.NewWithClaims(jwt.SigningMethodHS256, *t)
65 return token.SignedString([]byte(loginTokenSecret)) 64 return token.SignedString([]byte(loginTokenSecret))
66 } 65 }
67 66
68 func (t *LoginToken) ParseToken(str string) error { 67 func (t *LoginToken) ParseToken(str string) error {
69 tokenClaims, err := jwt.ParseWithClaims( 68 tokenClaims, err := jwt.ParseWithClaims(
70 str, 69 str,
71 - &LoginToken{}, 70 + t,
72 func(token *jwt.Token) (interface{}, error) { 71 func(token *jwt.Token) (interface{}, error) {
73 - return loginTokenSecret, nil 72 + return []byte(loginTokenSecret), nil
74 }) 73 })
75 if err != nil { 74 if err != nil {
76 return err 75 return err
@@ -3,7 +3,7 @@ package models @@ -3,7 +3,7 @@ package models
3 import "time" 3 import "time"
4 4
5 type LoginAccess struct { 5 type LoginAccess struct {
6 - tableName string `pg:"login_accesss,alias:login_access"` 6 + tableName string `pg:"login_access,alias:login_access"`
7 7
8 LoginAccessId int64 `pg:",pk"` 8 LoginAccessId int64 `pg:",pk"`
9 // 账号 9 // 账号
@@ -138,8 +138,8 @@ func (repository *LoginAccessRepository) Find(queryOptions map[string]interface{ @@ -138,8 +138,8 @@ func (repository *LoginAccessRepository) Find(queryOptions map[string]interface{
138 query := sqlbuilder.BuildQuery(tx.Model(&loginAccessModels), queryOptions) 138 query := sqlbuilder.BuildQuery(tx.Model(&loginAccessModels), queryOptions)
139 query.SetOffsetAndLimit(20) 139 query.SetOffsetAndLimit(20)
140 query.SetOrderDirect("login_access_id", "DESC") 140 query.SetOrderDirect("login_access_id", "DESC")
141 - query.SetWhereByQueryOption("account", "account")  
142 - query.SetWhereByQueryOption("platform", "platform") 141 + query.SetWhereByQueryOption("account = ?", "account")
  142 + query.SetWhereByQueryOption("platform = ?", "platform")
143 if count, err := query.SelectAndCount(); err != nil { 143 if count, err := query.SelectAndCount(); err != nil {
144 return 0, loginAccesss, err 144 return 0, loginAccesss, err
145 } else { 145 } else {
@@ -23,6 +23,6 @@ func NewHttplibAlliedCreationCooperation(operator domain.Operator) *HttplibAllie @@ -23,6 +23,6 @@ func NewHttplibAlliedCreationCooperation(operator domain.Operator) *HttplibAllie
23 UserId: operator.UserId, 23 UserId: operator.UserId,
24 UserBaseId: operator.UserBaseId, 24 UserBaseId: operator.UserBaseId,
25 }, 25 },
26 - baseUrL: constant.ALLIED_CREATION_USER_HOST, 26 + baseUrL: constant.ALLIED_CREATION_COOPERATION_HOST,
27 } 27 }
28 } 28 }
@@ -193,3 +193,34 @@ func (gateway HttplibAlliedCreationUser) AuthResetPhone(param ReqAuthResetPhone) @@ -193,3 +193,34 @@ func (gateway HttplibAlliedCreationUser) AuthResetPhone(param ReqAuthResetPhone)
193 err = gateway.GetResponseData(result, &data) 193 err = gateway.GetResponseData(result, &data)
194 return &data, err 194 return &data, err
195 } 195 }
  196 +
  197 +//RefreshIM 刷新IM信息
  198 +func (gateway HttplibAlliedCreationUser) AuthRefreshIM(param ReqAuthRefreshIM) (*DataAuthRefreshIM, error) {
  199 + url := gateway.baseUrL + "/auth/refresh-im"
  200 + method := "POST"
  201 + req := gateway.CreateRequest(url, method)
  202 + log.Logger.Debug("向用户模块请求数据:刷新IM信息。", map[string]interface{}{
  203 + "api": method + ":" + url,
  204 + "param": param,
  205 + })
  206 + req, err := req.JSONBody(param)
  207 + if err != nil {
  208 + return nil, fmt.Errorf("请求刷新IM信息失败:%w", err)
  209 + }
  210 +
  211 + byteResult, err := req.Bytes()
  212 + if err != nil {
  213 + return nil, fmt.Errorf("获取刷新IM信息失败:%w", err)
  214 + }
  215 + log.Logger.Debug("获取用户模块请求数据:刷新IM信息。", map[string]interface{}{
  216 + "result": string(byteResult),
  217 + })
  218 + var result service_gateway.GatewayResponse
  219 + err = json.Unmarshal(byteResult, &result)
  220 + if err != nil {
  221 + return nil, fmt.Errorf("解析刷新IM信息:%w", err)
  222 + }
  223 + var data DataAuthRefreshIM
  224 + err = gateway.GetResponseData(result, &data)
  225 + return &data, err
  226 +}
@@ -59,3 +59,21 @@ type ( @@ -59,3 +59,21 @@ type (
59 ReqAuthResetPassword struct{} 59 ReqAuthResetPassword struct{}
60 DataAuthResetPassword struct{} 60 DataAuthResetPassword struct{}
61 ) 61 )
  62 +
  63 +//重置手机号
  64 +type (
  65 + ReqAuthRefreshIM struct {
  66 + // 手机号码
  67 + Phone string `cname:"手机号码" json:"phone" valid:"Required"`
  68 + // 刷新标识 0:刷新IM信息,并返回 1:使用旧的im信息
  69 + RefreshFlag int `cname:"刷新标识" json:"refreshFlag"`
  70 + }
  71 + DataAuthRefreshIM struct {
  72 + // 网易云信ID
  73 + Accid string `json:"accid"`
  74 + // 网易云信Token
  75 + ImToken string `json:"imToken"`
  76 + // 系统分配客服ID
  77 + CsAccountId string `json:"csAccountId"`
  78 + }
  79 +)
@@ -41,6 +41,6 @@ func (controller *baseController) GetOperator() domain.Operator { @@ -41,6 +41,6 @@ func (controller *baseController) GetOperator() domain.Operator {
41 UserId: 9, 41 UserId: 9,
42 CompanyId: 23, 42 CompanyId: 23,
43 OrgId: 45, 43 OrgId: 45,
44 - UserBaseId: 1, 44 + UserBaseId: 5,
45 } 45 }
46 } 46 }
@@ -153,6 +153,8 @@ func (controller *CooperationController) GetCooperationProject() { @@ -153,6 +153,8 @@ func (controller *CooperationController) GetCooperationProject() {
153 return 153 return
154 } 154 }
155 cmd.Operator = controller.GetOperator() 155 cmd.Operator = controller.GetOperator()
  156 + projectId, _ := controller.GetInt(":projectId")
  157 + cmd.CooperationProjectId = projectId
156 data, err := svr.GetCooperationProject(cmd) 158 data, err := svr.GetCooperationProject(cmd)
157 controller.Response(data, err) 159 controller.Response(data, err)
158 } 160 }
@@ -18,6 +18,7 @@ func (controller *CooperationProjectController) CreateCooperationProject() { @@ -18,6 +18,7 @@ func (controller *CooperationProjectController) CreateCooperationProject() {
18 if err != nil { 18 if err != nil {
19 log.Logger.Debug("json err:" + err.Error()) 19 log.Logger.Debug("json err:" + err.Error())
20 } 20 }
  21 + createCooperationProjectCommand.Operator = controller.GetOperator()
21 data, err := cooperationProjectService.CreateCooperationProject(createCooperationProjectCommand) 22 data, err := cooperationProjectService.CreateCooperationProject(createCooperationProjectCommand)
22 controller.Response(data, err) 23 controller.Response(data, err)
23 } 24 }
@@ -31,6 +32,7 @@ func (controller *CooperationProjectController) UpdateCooperationProject() { @@ -31,6 +32,7 @@ func (controller *CooperationProjectController) UpdateCooperationProject() {
31 } 32 }
32 projectId := controller.GetString(":projectId") 33 projectId := controller.GetString(":projectId")
33 updateCooperationProjectCommand.CooperationProjectId = projectId 34 updateCooperationProjectCommand.CooperationProjectId = projectId
  35 + updateCooperationProjectCommand.Operator = controller.GetOperator()
34 data, err := cooperationProjectService.UpdateCooperationProject(updateCooperationProjectCommand) 36 data, err := cooperationProjectService.UpdateCooperationProject(updateCooperationProjectCommand)
35 controller.Response(data, err) 37 controller.Response(data, err)
36 } 38 }
@@ -40,6 +42,7 @@ func (controller *CooperationProjectController) GetCooperationProject() { @@ -40,6 +42,7 @@ func (controller *CooperationProjectController) GetCooperationProject() {
40 getCooperationProjectQuery := &query.GetCooperationProjectQuery{} 42 getCooperationProjectQuery := &query.GetCooperationProjectQuery{}
41 projectId, _ := controller.GetInt(":projectId") 43 projectId, _ := controller.GetInt(":projectId")
42 getCooperationProjectQuery.CooperationProjectId = projectId 44 getCooperationProjectQuery.CooperationProjectId = projectId
  45 + getCooperationProjectQuery.Operator = controller.GetOperator()
43 data, err := cooperationProjectService.GetCooperationProject(getCooperationProjectQuery) 46 data, err := cooperationProjectService.GetCooperationProject(getCooperationProjectQuery)
44 controller.Response(data, err) 47 controller.Response(data, err)
45 } 48 }
@@ -51,6 +54,7 @@ func (controller *CooperationProjectController) ListCooperationProject() { @@ -51,6 +54,7 @@ func (controller *CooperationProjectController) ListCooperationProject() {
51 if err != nil { 54 if err != nil {
52 log.Logger.Debug("json err:" + err.Error()) 55 log.Logger.Debug("json err:" + err.Error())
53 } 56 }
  57 + listCooperationProjectQuery.Operator = controller.GetOperator()
54 cnt, data, err := cooperationProjectService.ListCooperationProject(listCooperationProjectQuery) 58 cnt, data, err := cooperationProjectService.ListCooperationProject(listCooperationProjectQuery)
55 controller.returnPageListData(cnt, data, err, listCooperationProjectQuery.PageNumber) 59 controller.returnPageListData(cnt, data, err, listCooperationProjectQuery.PageNumber)
56 } 60 }
@@ -60,6 +64,7 @@ func (controller *CooperationProjectController) EndCooperationProject() { @@ -60,6 +64,7 @@ func (controller *CooperationProjectController) EndCooperationProject() {
60 endCooperationProjectCommand := &command.EndCooperationProjectCommand{} 64 endCooperationProjectCommand := &command.EndCooperationProjectCommand{}
61 controller.Unmarshal(endCooperationProjectCommand) 65 controller.Unmarshal(endCooperationProjectCommand)
62 //TODO 66 //TODO
  67 + endCooperationProjectCommand.Operator = controller.GetOperator()
63 data, err := cooperationProjectService.EndCooperationProject(endCooperationProjectCommand) 68 data, err := cooperationProjectService.EndCooperationProject(endCooperationProjectCommand)
64 controller.Response(data, err) 69 controller.Response(data, err)
65 } 70 }
@@ -12,7 +12,7 @@ func init() { @@ -12,7 +12,7 @@ func init() {
12 web.Router("/v1/app/auth/access-token", &mobile_client.AuthController{}, "Post:GetAuthAccessToken") 12 web.Router("/v1/app/auth/access-token", &mobile_client.AuthController{}, "Post:GetAuthAccessToken")
13 web.Router("/v1/app/auth/refresh-token", &mobile_client.AuthController{}, "Post:RefreshAuthAccessToken") 13 web.Router("/v1/app/auth/refresh-token", &mobile_client.AuthController{}, "Post:RefreshAuthAccessToken")
14 14
15 - web.Router("/v1/app/auth/user-info", &mobile_client.AuthController{}, "Post:GetUserInfo")  
16 - web.Router("/v1/app/auth/user-menu", &mobile_client.AuthController{}, "Post:GetUserMenus")  
17 - web.Router("/v1/app/auth/user-orgs", &mobile_client.AuthController{}, "Post:GetUserOrg") 15 + web.Router("/v1/app/user/user-info", &mobile_client.AuthController{}, "Post:GetUserInfo")
  16 + web.Router("/v1/app/user/user-menu", &mobile_client.AuthController{}, "Post:GetUserMenus")
  17 + web.Router("/v1/app/user/user-orgs", &mobile_client.AuthController{}, "Post:GetUserOrg")
18 } 18 }
@@ -11,4 +11,13 @@ func init() { @@ -11,4 +11,13 @@ func init() {
11 web.Router("/v1/web/cooperation-projects/:projectId", &web_client.CooperationProjectController{}, "Get:GetCooperationProject") 11 web.Router("/v1/web/cooperation-projects/:projectId", &web_client.CooperationProjectController{}, "Get:GetCooperationProject")
12 web.Router("/v1/web/cooperation-projects/search", &web_client.CooperationProjectController{}, "Post:ListCooperationProject") 12 web.Router("/v1/web/cooperation-projects/search", &web_client.CooperationProjectController{}, "Post:ListCooperationProject")
13 web.Router("/v1/web/cooperation-projects/end", &web_client.CooperationProjectController{}, "Put:EndCooperationProject") 13 web.Router("/v1/web/cooperation-projects/end", &web_client.CooperationProjectController{}, "Put:EndCooperationProject")
  14 +
  15 + /***** 1.共创模式 *****/
  16 + web.Router("/v1/web/cooperation-modes/", &web_client.CooperationModeController{}, "Post:CreateCooperationMode")
  17 + web.Router("/v1/web/cooperation-modes/:cooperationModeId", &web_client.CooperationModeController{}, "Put:UpdateCooperationMode")
  18 + web.Router("/v1/web/cooperation-modes/:cooperationModeId", &web_client.CooperationModeController{}, "Get:GetCooperationMode")
  19 + web.Router("/v1/web/cooperation-modes/:cooperationModeId", &web_client.CooperationModeController{}, "Delete:RemoveCooperationMode")
  20 + web.Router("/v1/web/cooperation-modes/search", &web_client.CooperationModeController{}, "Post:SearchCooperationMode")
  21 + web.Router("/v1/web/cooperation-modes/", &web_client.CooperationModeController{}, "Get:ListCooperationMode")
  22 +
14 } 23 }
@@ -2,6 +2,7 @@ package routers @@ -2,6 +2,7 @@ package routers
2 2
3 import ( 3 import (
4 "github.com/beego/beego/v2/server/web" 4 "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/mobile_client"
5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/web_client" 6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/web_client"
6 ) 7 )
7 8
@@ -12,4 +13,5 @@ func init() { @@ -12,4 +13,5 @@ func init() {
12 web.Router("/v1/web/orgs/:orgId", &web_client.OrgsController{}, "Get:OrgGet") 13 web.Router("/v1/web/orgs/:orgId", &web_client.OrgsController{}, "Get:OrgGet")
13 web.Router("/v1/web/orgs/enable", &web_client.OrgsController{}, "Post:OrgEnable") 14 web.Router("/v1/web/orgs/enable", &web_client.OrgsController{}, "Post:OrgEnable")
14 web.Router("/v1/web/orgs/departments", &web_client.OrgsController{}, "Post:OrgGetSubDepartment") 15 web.Router("/v1/web/orgs/departments", &web_client.OrgsController{}, "Post:OrgGetSubDepartment")
  16 + web.Router("/v1/web/orgs/department-users", &mobile_client.OrgController{}, "Post:DepartmentUsers")
15 } 17 }