作者 tangxuhui

更新用户模块

1 -{"D:\\workspaceGo\\src\\allied-creation-gateway\\pkg\\port\\beego":1627544330050447000}  
  1 +{"D:\\workspaceGo\\src\\allied-creation-gateway\\pkg\\port\\beego":1627550783476629200}
@@ -39,16 +39,15 @@ type UserRole struct { @@ -39,16 +39,15 @@ type UserRole struct {
39 } 39 }
40 40
41 type UserMenu struct { 41 type UserMenu struct {
42 - Category string `json:"category"`  
43 - Code string `json:"code"`  
44 - Icon string `json:"icon"`  
45 - MenuAlias string `json:"menuAlias"`  
46 - MenuID int `json:"menuId"`  
47 - MenuName string `json:"menuName"`  
48 - MenuType string `json:"menuType"`  
49 - ParentID int `json:"parentId"`  
50 - Remark string `json:"remark"`  
51 - Sort int `json:"sort"` 42 + Category string `json:"category"`
  43 + Code string `json:"code"`
  44 + Icon string `json:"icon"`
  45 + MenuID string `json:"menuId"`
  46 + MenuName string `json:"menuName"`
  47 + MenuType string `json:"menuType"`
  48 + ParentID string `json:"parentId"`
  49 + Remark string `json:"remark"`
  50 + Sort int `json:"sort"`
52 } 51 }
53 52
54 type CooperationUserInfo struct { 53 type CooperationUserInfo struct {
@@ -29,11 +29,29 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp @@ -29,11 +29,29 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp
29 if err != nil { 29 if err != nil {
30 return nil, err 30 return nil, err
31 } 31 }
32 - creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{}) 32 + resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{})
  33 + if err != nil {
  34 + return nil, err
  35 + }
33 var ( 36 var (
34 usersOrg []dto.UserOrg 37 usersOrg []dto.UserOrg
35 userRole []dto.UserRole 38 userRole []dto.UserRole
  39 + userMenu []dto.UserMenu
36 ) 40 )
  41 +
  42 + for _, v := range resultMenu.Menus {
  43 + userMenu = append(userMenu, dto.UserMenu{
  44 + Category: v.Category,
  45 + Code: v.Code,
  46 + Icon: v.Icon,
  47 + MenuName: v.MenuName,
  48 + MenuID: strconv.Itoa(v.MenuID),
  49 + MenuType: v.MenuType,
  50 + ParentID: strconv.Itoa(v.ParentID),
  51 + Remark: v.Remark,
  52 + Sort: v.Sort,
  53 + })
  54 + }
37 for _, v := range resultUser.UserOrg { 55 for _, v := range resultUser.UserOrg {
38 usersOrg = append(usersOrg, dto.UserOrg{ 56 usersOrg = append(usersOrg, dto.UserOrg{
39 OrgID: strconv.Itoa(v.OrgID), 57 OrgID: strconv.Itoa(v.OrgID),
@@ -64,7 +82,8 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp @@ -64,7 +82,8 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp
64 } 82 }
65 83
66 datas := map[string]interface{}{ 84 datas := map[string]interface{}{
67 - "user": user, 85 + "user": user,
  86 + "userMenu": userMenu,
68 } 87 }
69 return datas, err 88 return datas, err
70 } 89 }
@@ -282,5 +282,20 @@ type ( @@ -282,5 +282,20 @@ type (
282 UserId int `json:"userId"` 282 UserId int `json:"userId"`
283 } 283 }
284 DataUserAccessMenus struct { 284 DataUserAccessMenus struct {
  285 + Menus []struct {
  286 + AccessCode string `json:"accessCode"`
  287 + Category string `json:"category"`
  288 + Code string `json:"code"`
  289 + EnableStatus int `json:"enableStatus"`
  290 + Icon string `json:"icon"`
  291 + IsPublish int `json:"isPublish"`
  292 + MenuID int `json:"menuId"`
  293 + MenuName string `json:"menuName"`
  294 + MenuType string `json:"menuType"`
  295 + ParentID int `json:"parentId"`
  296 + ParentPath string `json:"parentPath"`
  297 + Remark string `json:"remark"`
  298 + Sort int `json:"sort"`
  299 + } `json:"menus"`
285 } 300 }
286 ) 301 )