作者 yangfu

Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway into dev

# Conflicts:
#	lastupdate.tmp
1 -{"F:\\go\\src\\allied-creation\\allied-creation-gateway\\pkg\\port\\beego\\routers":1627702781113454000}  
  1 +{"F:\\go\\src\\allied-creation\\allied-creation-gateway\\pkg\\port\\beego\\routers":1627719981417605200}
@@ -2,11 +2,14 @@ package command @@ -2,11 +2,14 @@ package command
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
5 6
6 "github.com/beego/beego/v2/core/validation" 7 "github.com/beego/beego/v2/core/validation"
7 ) 8 )
8 9
9 type MenuFavoriteCommand struct { 10 type MenuFavoriteCommand struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
10 // 企业id 13 // 企业id
11 CompanyId int64 `json:"companyId" valid:"Required"` 14 CompanyId int64 `json:"companyId" valid:"Required"`
12 // 对应菜单的id 15 // 对应菜单的id
@@ -10,12 +10,12 @@ import ( @@ -10,12 +10,12 @@ import (
10 type MenuUpdateCommand struct { 10 type MenuUpdateCommand struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
13 - // 企业id  
14 - CompanyId int64 `json:"companyId" valid:"Required"`  
15 // 菜单编号 13 // 菜单编号
16 MenuId int64 `json:"menuId" valid:"Required"` 14 MenuId int64 `json:"menuId" valid:"Required"`
17 // 菜单名称 15 // 菜单名称
18 MenuName string `json:"menuName" valid:"Required"` 16 MenuName string `json:"menuName" valid:"Required"`
  17 + // 菜单名称
  18 + MenuAlias string `json:"menuAlias" valid:"Required"`
19 // 排序 19 // 排序
20 Sort int `json:"sort" valid:"Required"` 20 Sort int `json:"sort" valid:"Required"`
21 } 21 }
@@ -10,6 +10,8 @@ import ( @@ -10,6 +10,8 @@ import (
10 type MenuListQuery struct { 10 type MenuListQuery struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
  13 + // 菜单类别 web app
  14 + MenuCategory string `json:"menuCategory"`
13 } 15 }
14 16
15 func (menuListQuery *MenuListQuery) Valid(validation *validation.Validation) { 17 func (menuListQuery *MenuListQuery) Valid(validation *validation.Validation) {
@@ -13,8 +13,17 @@ type MenuService struct { @@ -13,8 +13,17 @@ type MenuService struct {
13 13
14 // 设置收藏菜单 14 // 设置收藏菜单
15 func (menuService *MenuService) MenuFavorite(menuFavoriteCommand *command.MenuFavoriteCommand) (interface{}, error) { 15 func (menuService *MenuService) MenuFavorite(menuFavoriteCommand *command.MenuFavoriteCommand) (interface{}, error) {
16 -  
17 - return nil, nil 16 + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
  17 + menuFavoriteCommand.Operator.CompanyId,
  18 + menuFavoriteCommand.Operator.OrgId,
  19 + menuFavoriteCommand.Operator.UserId)
  20 + result, err := creationUserGateway.CompanyGetCustomizeMenus(allied_creation_user.ReqCompanyGetCustomizeMenus{
  21 + CompanyId: menuFavoriteCommand.Operator.CompanyId,
  22 + })
  23 + if err != nil {
  24 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  25 + }
  26 + return result, nil
18 } 27 }
19 28
20 // 返回菜单列表 29 // 返回菜单列表
@@ -25,11 +34,14 @@ func (menuService *MenuService) MenuList(menuListQuery *query.MenuListQuery) (in @@ -25,11 +34,14 @@ func (menuService *MenuService) MenuList(menuListQuery *query.MenuListQuery) (in
25 menuListQuery.Operator.UserId) 34 menuListQuery.Operator.UserId)
26 result, err := creationUserGateway.CompanyGetCustomizeMenus(allied_creation_user.ReqCompanyGetCustomizeMenus{ 35 result, err := creationUserGateway.CompanyGetCustomizeMenus(allied_creation_user.ReqCompanyGetCustomizeMenus{
27 CompanyId: menuListQuery.Operator.CompanyId, 36 CompanyId: menuListQuery.Operator.CompanyId,
  37 + MenuCategory: menuListQuery.MenuCategory,
28 }) 38 })
29 if err != nil { 39 if err != nil {
30 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 40 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
31 } 41 }
32 - return result, nil 42 + return map[string]interface{}{
  43 + "menus": result.Menus,
  44 + }, nil
33 } 45 }
34 46
35 // 更新菜单 47 // 更新菜单
@@ -39,8 +51,8 @@ func (menuService *MenuService) MenuUpdate(menuUpdateCommand *command.MenuUpdate @@ -39,8 +51,8 @@ func (menuService *MenuService) MenuUpdate(menuUpdateCommand *command.MenuUpdate
39 menuUpdateCommand.Operator.OrgId, 51 menuUpdateCommand.Operator.OrgId,
40 menuUpdateCommand.Operator.UserId) 52 menuUpdateCommand.Operator.UserId)
41 _, err := creationUserGateway.CompanySetCustomizeMenus(allied_creation_user.ReqCompanySetCustomizeMenus{ 53 _, err := creationUserGateway.CompanySetCustomizeMenus(allied_creation_user.ReqCompanySetCustomizeMenus{
42 - CompanyId: menuUpdateCommand.CompanyId,  
43 - MenuAlias: menuUpdateCommand.MenuName, 54 + CompanyId: menuUpdateCommand.Operator.CompanyId,
  55 + MenuAlias: menuUpdateCommand.MenuAlias,
44 MenuId: int(menuUpdateCommand.MenuId), 56 MenuId: int(menuUpdateCommand.MenuId),
45 Sort: menuUpdateCommand.Sort, 57 Sort: menuUpdateCommand.Sort,
46 }) 58 })
@@ -127,11 +127,13 @@ func (orgsService *OrgsService) OrgUpdate(orgUpdateCommand *command.OrgUpdateCom @@ -127,11 +127,13 @@ func (orgsService *OrgsService) OrgUpdate(orgUpdateCommand *command.OrgUpdateCom
127 orgUpdateCommand.Operator.OrgId, 127 orgUpdateCommand.Operator.OrgId,
128 orgUpdateCommand.Operator.UserId) 128 orgUpdateCommand.Operator.UserId)
129 parentId, _ := strconv.Atoi(orgUpdateCommand.ParentId) 129 parentId, _ := strconv.Atoi(orgUpdateCommand.ParentId)
130 - _, err := creationUserGateway.OrgCreate(allied_creation_user.ReqOrgCreate{ 130 + orgId, _ := strconv.Atoi(orgUpdateCommand.OrgId)
  131 + _, err := creationUserGateway.OrgUpdate(allied_creation_user.ReqOrgUpdate{
  132 + OrgId: int64(orgId),
131 IsOrg: orgUpdateCommand.IsOrg, 133 IsOrg: orgUpdateCommand.IsOrg,
132 OrgCode: orgUpdateCommand.OrgCode, 134 OrgCode: orgUpdateCommand.OrgCode,
133 OrgName: orgUpdateCommand.OrgName, 135 OrgName: orgUpdateCommand.OrgName,
134 - ParentId: parentId, 136 + ParentId: int64(parentId),
135 }) 137 })
136 if err != nil { 138 if err != nil {
137 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 139 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -10,7 +10,7 @@ import ( @@ -10,7 +10,7 @@ import (
10 type CompanyUserResetPasswordCommand struct { 10 type CompanyUserResetPasswordCommand struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
13 - UsersIds []string `json:"usersIds" valid:"Required"` 13 + UserIds []string `json:"userIds" valid:"Required"`
14 } 14 }
15 15
16 func (companyUserResetPasswordCommand *CompanyUserResetPasswordCommand) Valid(validation *validation.Validation) { 16 func (companyUserResetPasswordCommand *CompanyUserResetPasswordCommand) Valid(validation *validation.Validation) {
@@ -11,9 +11,9 @@ type CooperationUserAddCommand struct { @@ -11,9 +11,9 @@ type CooperationUserAddCommand struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
13 // 用户编号 13 // 用户编号
14 - UsersCode string `json:"usersCode" valid:"Required"` 14 + UsersCode string `json:"userCode" valid:"Required"`
15 // 用户姓名 15 // 用户姓名
16 - UsersName string `json:"usersName" valid:"Required"` 16 + UsersName string `json:"userName" valid:"Required"`
17 // 共创公司 17 // 共创公司
18 CooperationCompany string `json:"cooperationCompany" valid:"Required"` 18 CooperationCompany string `json:"cooperationCompany" valid:"Required"`
19 // 共创公司到期时间 19 // 共创公司到期时间
@@ -11,7 +11,7 @@ type CooperationUserEnableCommand struct { @@ -11,7 +11,7 @@ type CooperationUserEnableCommand struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
13 //用户id 13 //用户id
14 - UsersIds []string `json:"usersIds,omitempty"` 14 + UsersIds []string `json:"userIds,omitempty"`
15 // 启用状态(启用:1 禁用:2) 15 // 启用状态(启用:1 禁用:2)
16 EnableStatus int `json:"enableStatus,omitempty"` 16 EnableStatus int `json:"enableStatus,omitempty"`
17 } 17 }
@@ -10,7 +10,7 @@ import ( @@ -10,7 +10,7 @@ import (
10 type CooperationUserResetPasswordCommand struct { 10 type CooperationUserResetPasswordCommand struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
13 - UsersIds []int64 `json:"usersIds" valid:"Required"` 13 + UserIds []string `json:"userIds" valid:"Required"`
14 } 14 }
15 15
16 func (cooperationUserResetPasswordCommand *CooperationUserResetPasswordCommand) Valid(validation *validation.Validation) { 16 func (cooperationUserResetPasswordCommand *CooperationUserResetPasswordCommand) Valid(validation *validation.Validation) {
@@ -11,11 +11,11 @@ type CooperationUserUpdateCommand struct { @@ -11,11 +11,11 @@ type CooperationUserUpdateCommand struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
13 // 用户编号 13 // 用户编号
14 - UsersId int64 `json:"usersId" valid:"Required"` 14 + UserId int64 `json:"userId" valid:"Required"`
15 // 用户编号 15 // 用户编号
16 - UsersCode string `json:"usersCode" valid:"Required"` 16 + UserCode string `json:"userCode" valid:"Required"`
17 // 用户姓名 17 // 用户姓名
18 - UsersName string `json:"usersName" valid:"Required"` 18 + UserName string `json:"userName" valid:"Required"`
19 // 共创公司 19 // 共创公司
20 CooperationCompany string `json:"cooperationCompany" valid:"Required"` 20 CooperationCompany string `json:"cooperationCompany" valid:"Required"`
21 // 共创公司到期时间 21 // 共创公司到期时间
@@ -23,7 +23,7 @@ type CooperationUserUpdateCommand struct { @@ -23,7 +23,7 @@ type CooperationUserUpdateCommand struct {
23 // 启用状态(启用:1 禁用:2) 23 // 启用状态(启用:1 禁用:2)
24 EnableStatus int `json:"enableStatus" valid:"Required"` 24 EnableStatus int `json:"enableStatus" valid:"Required"`
25 // 邮箱 25 // 邮箱
26 - Email string `json:"email" valid:"Required"` 26 + Email string `json:"email"`
27 //头像 27 //头像
28 Avatar string `json:"avatar"` 28 Avatar string `json:"avatar"`
29 29
@@ -76,7 +76,7 @@ type CooperationUserInfo struct { @@ -76,7 +76,7 @@ type CooperationUserInfo struct {
76 type CooperationUserItem struct { 76 type CooperationUserItem struct {
77 CooperationCompany string `json:"cooperationCompany"` 77 CooperationCompany string `json:"cooperationCompany"`
78 UserId string `json:"userId"` 78 UserId string `json:"userId"`
79 - CooperationDeadline int64 `json:"cooperationDeadline"` 79 + CooperationDeadline string `json:"cooperationDeadline"`
80 Phone string `json:"phone"` 80 Phone string `json:"phone"`
81 EnableStatus int `json:"enableStatus"` 81 EnableStatus int `json:"enableStatus"`
82 UserCode string `json:"userCode"` 82 UserCode string `json:"userCode"`
@@ -210,8 +210,8 @@ func (usersService *UsersService) CompanyUserResetPassword(companyUserResetPassw @@ -210,8 +210,8 @@ func (usersService *UsersService) CompanyUserResetPassword(companyUserResetPassw
210 companyUserResetPasswordCommand.Operator.OrgId, 210 companyUserResetPasswordCommand.Operator.OrgId,
211 companyUserResetPasswordCommand.Operator.UserId) 211 companyUserResetPasswordCommand.Operator.UserId)
212 var userIds []int64 212 var userIds []int64
213 - for i := range companyUserResetPasswordCommand.UsersIds {  
214 - id, _ := strconv.Atoi(companyUserResetPasswordCommand.UsersIds[i]) 213 + for i := range companyUserResetPasswordCommand.UserIds {
  214 + id, _ := strconv.Atoi(companyUserResetPasswordCommand.UserIds[i])
215 userIds = append(userIds, int64(id)) 215 userIds = append(userIds, int64(id))
216 } 216 }
217 _, err := creationUserGateway.UserBatchResetPassword(allied_creation_user.ReqBatchResetPasswordUser{ 217 _, err := creationUserGateway.UserBatchResetPassword(allied_creation_user.ReqBatchResetPasswordUser{
@@ -274,8 +274,9 @@ func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand * @@ -274,8 +274,9 @@ func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand *
274 cooperationUserAddCommand.Operator.OrgId, 274 cooperationUserAddCommand.Operator.OrgId,
275 cooperationUserAddCommand.Operator.UserId) 275 cooperationUserAddCommand.Operator.UserId)
276 result, err := creationUserGateway.CooperatorUserCreate(allied_creation_user.ReqCreateCooperatorUser{ 276 result, err := creationUserGateway.CooperatorUserCreate(allied_creation_user.ReqCreateCooperatorUser{
  277 + CompanyId: cooperationUserAddCommand.Operator.CompanyId,
277 CooperationCompany: cooperationUserAddCommand.CooperationCompany, 278 CooperationCompany: cooperationUserAddCommand.CooperationCompany,
278 - CooperationDeadline: time.Unix(cooperationUserAddCommand.CooperationDeadline, 0), 279 + CooperationDeadline: time.Unix(cooperationUserAddCommand.CooperationDeadline/1000, 0),
279 Email: cooperationUserAddCommand.Email, 280 Email: cooperationUserAddCommand.Email,
280 EnableStatus: cooperationUserAddCommand.EnableStatus, 281 EnableStatus: cooperationUserAddCommand.EnableStatus,
281 UserCode: cooperationUserAddCommand.UsersCode, 282 UserCode: cooperationUserAddCommand.UsersCode,
@@ -360,6 +361,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery * @@ -360,6 +361,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery *
360 CooperationCompany: cooperationUserListQuery.CooperationCompany, 361 CooperationCompany: cooperationUserListQuery.CooperationCompany,
361 DepName: "", 362 DepName: "",
362 Phone: "", 363 Phone: "",
  364 + UserType: 2,
363 }) 365 })
364 var ( 366 var (
365 listData []dto.CooperationUserItem 367 listData []dto.CooperationUserItem
@@ -370,7 +372,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery * @@ -370,7 +372,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery *
370 item = dto.CooperationUserItem{ 372 item = dto.CooperationUserItem{
371 CooperationCompany: v.CooperationInfo.CooperationCompany, 373 CooperationCompany: v.CooperationInfo.CooperationCompany,
372 UserId: strconv.Itoa(v.UserId), 374 UserId: strconv.Itoa(v.UserId),
373 - CooperationDeadline: v.CooperationInfo.CooperationDeadline.Unix(), 375 + CooperationDeadline: v.CooperationInfo.CooperationDeadline.Format("2006-01-02"),
374 Phone: v.UserInfo.Phone, 376 Phone: v.UserInfo.Phone,
375 EnableStatus: v.EnableStatus, 377 EnableStatus: v.EnableStatus,
376 UserCode: v.UserCode, 378 UserCode: v.UserCode,
@@ -389,14 +391,20 @@ func (usersService *UsersService) CooperationUserResetPassword(cooperationUserRe @@ -389,14 +391,20 @@ func (usersService *UsersService) CooperationUserResetPassword(cooperationUserRe
389 cooperationUserResetPasswordCommand.Operator.CompanyId, 391 cooperationUserResetPasswordCommand.Operator.CompanyId,
390 cooperationUserResetPasswordCommand.Operator.OrgId, 392 cooperationUserResetPasswordCommand.Operator.OrgId,
391 cooperationUserResetPasswordCommand.Operator.UserId) 393 cooperationUserResetPasswordCommand.Operator.UserId)
  394 + var userIds []int64
  395 + for i := range cooperationUserResetPasswordCommand.UserIds {
  396 + id, _ := strconv.Atoi(cooperationUserResetPasswordCommand.UserIds[i])
  397 + userIds = append(userIds, int64(id))
  398 + }
392 _, err := creationUserGateway.UserBatchResetPassword(allied_creation_user.ReqBatchResetPasswordUser{ 399 _, err := creationUserGateway.UserBatchResetPassword(allied_creation_user.ReqBatchResetPasswordUser{
393 - Password: "", //TODO 填充密码  
394 - UserIds: cooperationUserResetPasswordCommand.UsersIds, 400 + Password: "123456", //TODO 填充密码
  401 + UserIds: userIds,
395 }) 402 })
396 if err != nil { 403 if err != nil {
397 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 404 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
398 } 405 }
399 - return cooperationUserResetPasswordCommand, err 406 + // TODO:返回消息提示 密码重置成功,初始密码为TL123456!
  407 + return "123456", err
400 } 408 }
401 409
402 // 编辑共创用户信息 410 // 编辑共创用户信息
@@ -406,13 +414,13 @@ func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCom @@ -406,13 +414,13 @@ func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCom
406 cooperationUserUpdateCommand.Operator.OrgId, 414 cooperationUserUpdateCommand.Operator.OrgId,
407 cooperationUserUpdateCommand.Operator.UserId) 415 cooperationUserUpdateCommand.Operator.UserId)
408 _, err := creationUserGateway.CooperatorUserUpdate(allied_creation_user.ReqUpdateCooperatorUser{ 416 _, err := creationUserGateway.CooperatorUserUpdate(allied_creation_user.ReqUpdateCooperatorUser{
409 - UserId: cooperationUserUpdateCommand.UsersId, 417 + UserId: cooperationUserUpdateCommand.UserId,
410 CooperationCompany: cooperationUserUpdateCommand.CooperationCompany, 418 CooperationCompany: cooperationUserUpdateCommand.CooperationCompany,
411 CooperationDeadline: time.Unix(cooperationUserUpdateCommand.CooperationDeadline, 0), 419 CooperationDeadline: time.Unix(cooperationUserUpdateCommand.CooperationDeadline, 0),
412 Email: cooperationUserUpdateCommand.Email, 420 Email: cooperationUserUpdateCommand.Email,
413 EnableStatus: cooperationUserUpdateCommand.EnableStatus, 421 EnableStatus: cooperationUserUpdateCommand.EnableStatus,
414 - UserCode: cooperationUserUpdateCommand.UsersCode,  
415 - UserName: cooperationUserUpdateCommand.UsersName, 422 + UserCode: cooperationUserUpdateCommand.UserCode,
  423 + UserName: cooperationUserUpdateCommand.UserName,
416 Avatar: cooperationUserUpdateCommand.Avatar, 424 Avatar: cooperationUserUpdateCommand.Avatar,
417 OrgId: cooperationUserUpdateCommand.Operator.OrgId, 425 OrgId: cooperationUserUpdateCommand.Operator.OrgId,
418 Phone: cooperationUserUpdateCommand.Phone, 426 Phone: cooperationUserUpdateCommand.Phone,
@@ -197,7 +197,7 @@ func (gateway HttplibAlliedCreationUser) CompanySearch(param ReqCompanySearch) ( @@ -197,7 +197,7 @@ func (gateway HttplibAlliedCreationUser) CompanySearch(param ReqCompanySearch) (
197 197
198 // CompanyGetCustomizeMenus 返回自定义菜单列表 198 // CompanyGetCustomizeMenus 返回自定义菜单列表
199 func (gateway HttplibAlliedCreationUser) CompanyGetCustomizeMenus(param ReqCompanyGetCustomizeMenus) (*DataCompanyGetCustomizeMenus, error) { 199 func (gateway HttplibAlliedCreationUser) CompanyGetCustomizeMenus(param ReqCompanyGetCustomizeMenus) (*DataCompanyGetCustomizeMenus, error) {
200 - url := gateway.baseUrL + "/company/" + strconv.FormatInt(param.CompanyId, 10) + "/customize-menus" 200 + url := gateway.baseUrL + "/company/" + strconv.FormatInt(param.CompanyId, 10) + "/customize-menus?menuCategory=" + param.MenuCategory
201 method := "get" 201 method := "get"
202 req := gateway.CreateRequest(url, method) 202 req := gateway.CreateRequest(url, method)
203 log.Logger.Debug("向用户模块请求数据:返回自定义菜单列表。", map[string]interface{}{ 203 log.Logger.Debug("向用户模块请求数据:返回自定义菜单列表。", map[string]interface{}{
@@ -63,7 +63,9 @@ type ( @@ -63,7 +63,9 @@ type (
63 //返回自定义菜单列表 63 //返回自定义菜单列表
64 type ( 64 type (
65 ReqCompanyGetCustomizeMenus struct { 65 ReqCompanyGetCustomizeMenus struct {
66 - CompanyId int64 66 + CompanyId int64 `json:"companyId"`
  67 + // 菜单类别 web app
  68 + MenuCategory string `cname:"菜单类别" json:"menuCategory,omitempty"`
67 } 69 }
68 70
69 DataCompanyGetCustomizeMenus struct { 71 DataCompanyGetCustomizeMenus struct {
@@ -19,6 +19,14 @@ type ( @@ -19,6 +19,14 @@ type (
19 type ( 19 type (
20 ReqOrgUpdate struct { 20 ReqOrgUpdate struct {
21 OrgId int64 21 OrgId int64
  22 + // 组织编码
  23 + OrgCode string `cname:"组织编码" json:"orgCode"`
  24 + // 组织名称
  25 + OrgName string `cname:"组织名称" json:"orgName"`
  26 + // 是否是组织(是:1 不是:2)
  27 + IsOrg int `cname:"是否是组织(是:1 不是:2)" json:"isOrg"`
  28 + // 父级ID
  29 + ParentId int64 `cname:"父级ID" json:"parentId" valid:"Required"`
22 } 30 }
23 31
24 DataOrgUpdate struct { 32 DataOrgUpdate struct {
@@ -211,6 +211,8 @@ type ( @@ -211,6 +211,8 @@ type (
211 //创建共创用户 211 //创建共创用户
212 type ( 212 type (
213 ReqCreateCooperatorUser struct { 213 ReqCreateCooperatorUser struct {
  214 + // 企业ID
  215 + CompanyId int64 `cname:"企业ID" json:"companyId"`
214 // 共创公司 216 // 共创公司
215 CooperationCompany string ` json:"cooperationCompany"` 217 CooperationCompany string ` json:"cooperationCompany"`
216 // 共创到期时间 218 // 共创到期时间
@@ -13,6 +13,7 @@ type MenuController struct { @@ -13,6 +13,7 @@ type MenuController struct {
13 func (controller *MenuController) MenuList() { 13 func (controller *MenuController) MenuList() {
14 menuService := service.NewMenuService(nil) 14 menuService := service.NewMenuService(nil)
15 menuListQuery := &query.MenuListQuery{} 15 menuListQuery := &query.MenuListQuery{}
  16 + controller.Unmarshal(menuListQuery)
16 menuListQuery.Operator = controller.GetOperator() 17 menuListQuery.Operator = controller.GetOperator()
17 data, err := menuService.MenuList(menuListQuery) 18 data, err := menuService.MenuList(menuListQuery)
18 controller.Response(data, err) 19 controller.Response(data, err)
@@ -31,6 +32,7 @@ func (controller *MenuController) MenuFavorite() { @@ -31,6 +32,7 @@ func (controller *MenuController) MenuFavorite() {
31 menuService := service.NewMenuService(nil) 32 menuService := service.NewMenuService(nil)
32 menuFavoriteCommand := &command.MenuFavoriteCommand{} 33 menuFavoriteCommand := &command.MenuFavoriteCommand{}
33 controller.Unmarshal(menuFavoriteCommand) 34 controller.Unmarshal(menuFavoriteCommand)
  35 + menuFavoriteCommand.Operator = controller.GetOperator()
34 data, err := menuService.MenuFavorite(menuFavoriteCommand) 36 data, err := menuService.MenuFavorite(menuFavoriteCommand)
35 controller.Response(data, err) 37 controller.Response(data, err)
36 } 38 }
@@ -4,6 +4,7 @@ import ( @@ -4,6 +4,7 @@ import (
4 "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"
5 "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"
6 "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"
  7 + "strconv"
7 ) 8 )
8 9
9 type UsersController struct { 10 type UsersController struct {
@@ -78,6 +79,8 @@ func (controller *UsersController) CooperationUserUpdate() { @@ -78,6 +79,8 @@ func (controller *UsersController) CooperationUserUpdate() {
78 usersService := service.NewUsersService(nil) 79 usersService := service.NewUsersService(nil)
79 cooperationUserUpdateCommand := &command.CooperationUserUpdateCommand{} 80 cooperationUserUpdateCommand := &command.CooperationUserUpdateCommand{}
80 controller.Unmarshal(cooperationUserUpdateCommand) 81 controller.Unmarshal(cooperationUserUpdateCommand)
  82 + userId := controller.GetString(":userId")
  83 + cooperationUserUpdateCommand.UserId, _ = strconv.ParseInt(userId, 10, 64)
81 cooperationUserUpdateCommand.Operator = controller.GetOperator() 84 cooperationUserUpdateCommand.Operator = controller.GetOperator()
82 data, err := usersService.CooperationUserUpdate(cooperationUserUpdateCommand) 85 data, err := usersService.CooperationUserUpdate(cooperationUserUpdateCommand)
83 controller.Response(data, err) 86 controller.Response(data, err)
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/web_client"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/v1/web/menus/search", &web_client.MenuController{}, "Post:MenuList")
  10 + web.Router("/v1/web/menus", &web_client.MenuController{}, "Put:MenuUpdate")
  11 + web.Router("/v1/web/menus/favorite", &web_client.MenuController{}, "Put:MenuFavorite")
  12 +}
@@ -13,7 +13,7 @@ func init() { @@ -13,7 +13,7 @@ func init() {
13 web.Router("/v1/web/users/company-user/enable", &web_client.UsersController{}, "Put:CompanyUserEnable") 13 web.Router("/v1/web/users/company-user/enable", &web_client.UsersController{}, "Put:CompanyUserEnable")
14 web.Router("/v1/web/users/company-user/reset-password", &web_client.UsersController{}, "Put:CompanyUserResetPassword") 14 web.Router("/v1/web/users/company-user/reset-password", &web_client.UsersController{}, "Put:CompanyUserResetPassword")
15 web.Router("/v1/web/users/cooperation-user", &web_client.UsersController{}, "Post:CooperationUserAdd") 15 web.Router("/v1/web/users/cooperation-user", &web_client.UsersController{}, "Post:CooperationUserAdd")
16 - web.Router("/v1/web/users/cooperation-user", &web_client.UsersController{}, "Put:CooperationUserUpdate") 16 + web.Router("/v1/web/users/cooperation-user/:userId", &web_client.UsersController{}, "Put:CooperationUserUpdate")
17 web.Router("/v1/web/users/cooperation-user/search", &web_client.UsersController{}, "Post:CooperationUserList") 17 web.Router("/v1/web/users/cooperation-user/search", &web_client.UsersController{}, "Post:CooperationUserList")
18 web.Router("/v1/web/users/cooperation-user/:userId", &web_client.UsersController{}, "Get:CooperationUserGet") 18 web.Router("/v1/web/users/cooperation-user/:userId", &web_client.UsersController{}, "Get:CooperationUserGet")
19 web.Router("/v1/web/users/cooperation-user/enable", &web_client.UsersController{}, "Put:CooperationUserEnable") 19 web.Router("/v1/web/users/cooperation-user/enable", &web_client.UsersController{}, "Put:CooperationUserEnable")