作者 yangfu

add services org role users usersCompany

正在显示 44 个修改的文件 包含 555 行增加85 行删除
@@ -2,6 +2,6 @@ version: v1 @@ -2,6 +2,6 @@ version: v1
2 kind: Attribute 2 kind: Attribute
3 metadata: 3 metadata:
4 name: isPublish 4 name: isPublish
5 - description: 菜单是否公开状态,[0:隐藏],[1:显示],默认显示 5 + description: 菜单是否公开状态(上架、下架),[0:隐藏],[1:显示],默认显示
6 type: 6 type:
7 primitive: int 7 primitive: int
@@ -10,6 +10,8 @@ metadata: @@ -10,6 +10,8 @@ metadata:
10 required: true 10 required: true
11 - ref: logo 11 - ref: logo
12 required: true 12 required: true
  13 + - ref: address
  14 + required: true
13 - ref: industryCategory 15 - ref: industryCategory
14 required: true 16 required: true
15 - ref: contacts 17 - ref: contacts
@@ -12,3 +12,8 @@ metadata: @@ -12,3 +12,8 @@ metadata:
12 required: true 12 required: true
13 - ref: depName 13 - ref: depName
14 required: true 14 required: true
  15 + - name: parentDepName
  16 + description: 父级部门名称
  17 + type:
  18 + primitive: string
  19 + required: true
@@ -30,5 +30,8 @@ metadata: @@ -30,5 +30,8 @@ metadata:
30 description: 父级节点路径("0,11,12,") 30 description: 父级节点路径("0,11,12,")
31 type: 31 type:
32 primitive: string 32 primitive: string
  33 + - ref: enableStatus
  34 + description: 启用状态(启用:1 禁用:0)
  35 + required: true
33 - ref: isPublish 36 - ref: isPublish
34 required: true 37 required: true
@@ -18,6 +18,10 @@ metadata: @@ -18,6 +18,10 @@ metadata:
18 required: true 18 required: true
19 - ref: orgName 19 - ref: orgName
20 required: true 20 required: true
  21 + - name: ext
  22 + description: 扩展数据
  23 + type:
  24 + schema: ext
21 - name: isOrg 25 - name: isOrg
22 required: true 26 required: true
23 - ref: parentId 27 - ref: parentId
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: companySignUp
  5 + type: command
  6 + description: 企业注册
  7 + payload:
  8 + - ref: companyName
  9 + required: true
  10 + - ref: contacts
  11 + required: true
  12 + - ref: phone
  13 + required: true
  14 + - ref: scale
  15 + required: true
  16 + - ref: industryCategory
  17 + required: true
  18 + - ref: password
  19 + required: true
  20 + result:
  21 + - name: users
  22 + type:
  23 + schema: users
  24 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: resetPassword
  5 + type: command
  6 + description: 重置密码
  7 + payload:
  8 + - ref: phone
  9 + required: true
  10 + - ref: password
  11 + required: true
  12 + result:
  13 + - name: msg
  14 + description: 消息
  15 + type:
  16 + primitive: string
  1 +version: v1
  2 +kind: Service
  3 +metadata:
  4 + name: auth
  5 + description: 认证服务
@@ -42,6 +42,9 @@ metadata: @@ -42,6 +42,9 @@ metadata:
42 description: 菜单说明 42 description: 菜单说明
43 type: 43 type:
44 primitive: string 44 primitive: string
  45 + - ref: enableStatus
  46 + description: 启用状态(启用:1 禁用:0)
  47 + required: true
45 - name: isPublish 48 - name: isPublish
46 description: 菜单是否公开状态,[0:隐藏],[1:显示],默认显示 49 description: 菜单是否公开状态,[0:隐藏],[1:显示],默认显示
47 type: 50 type:
@@ -43,6 +43,9 @@ metadata: @@ -43,6 +43,9 @@ metadata:
43 description: 菜单是否公开状态,[0:隐藏],[1:显示],默认显示 43 description: 菜单是否公开状态,[0:隐藏],[1:显示],默认显示
44 type: 44 type:
45 primitive: int 45 primitive: int
  46 + - ref: enableStatus
  47 + description: 启用状态(启用:1 禁用:0)
  48 + required: true
46 result: 49 result:
47 - name: menu 50 - name: menu
48 type: 51 type:
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: createOrg
  5 + type: command
  6 + description: 创建组织管理
  7 + payload:
  8 + - ref: companyId
  9 + required: true
  10 + - ref: orgCode
  11 + required: true
  12 + - ref: orgName
  13 + required: true
  14 + - name: isOrg
  15 + required: true
  16 + - ref: parentId
  17 + required: true
  18 + result:
  19 + - name: org
  20 + type:
  21 + schema: org
  22 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: getOrg
  5 + type: query
  6 + description: 返回组织管理
  7 + payload:
  8 + - ref: orgId
  9 + required: true
  10 + result:
  11 + - name: org
  12 + type:
  13 + schema: org
  14 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: listOrg
  5 + type: query
  6 + description: 返回组织管理列表
  7 + payload:
  8 + - ref: offset
  9 + required: true
  10 + - ref: limit
  11 + required: true
  12 + - ref: orgCode
  13 + required: false
  14 + - ref: depName
  15 + required: false
  16 + - ref: parentId
  17 + required: false
  18 + result:
  19 + - ref: count
  20 + required: true
  21 + - name: orgs
  22 + type:
  23 + array: org
  24 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: removeOrg
  5 + type: command
  6 + description: 移除组织管理
  7 + payload:
  8 + - ref: orgId
  9 + required: true
  10 + result:
  11 + - name: org
  12 + type:
  13 + schema: org
  14 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: updateOrg
  5 + type: command
  6 + description: 更新组织管理
  7 + payload:
  8 + - ref: orgId
  9 + required: true
  10 + - ref: orgCode
  11 + required: true
  12 + - ref: orgName
  13 + required: true
  14 + - name: isOrg
  15 + required: true
  16 + - ref: parentId
  17 + required: true
  18 + result:
  19 + - name: org
  20 + type:
  21 + schema: org
  22 + required: true
  1 +version: v1
  2 +kind: Service
  3 +metadata:
  4 + name: org
  5 + description: 组织管理
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: createRole
  5 + type: command
  6 + description: 创建角色管理
  7 + payload:
  8 + - ref: roleName
  9 + required: true
  10 + - ref: desc
  11 + required: false
  12 + result:
  13 + - name: role
  14 + type:
  15 + schema: role
  16 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: getRole
  5 + type: query
  6 + description: 返回角色管理
  7 + payload:
  8 + - ref: roleId
  9 + required: true
  10 + result:
  11 + - name: role
  12 + type:
  13 + schema: role
  14 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: listRole
  5 + type: query
  6 + description: 返回角色管理列表
  7 + payload:
  8 + - ref: offset
  9 + required: true
  10 + - ref: limit
  11 + required: true
  12 + - ref: roleName
  13 + required: false
  14 + - ref: orgName
  15 + required: false
  16 + result:
  17 + - ref: count
  18 + required: true
  19 + - name: roles
  20 + type:
  21 + array: role
  22 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: removeRole
  5 + type: command
  6 + description: 移除角色管理
  7 + payload:
  8 + - ref: roleId
  9 + required: true
  10 + result:
  11 + - name: role
  12 + type:
  13 + schema: role
  14 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: updateRole
  5 + type: command
  6 + description: 更新角色管理
  7 + payload:
  8 + - ref: roleId
  9 + required: true
  10 + - ref: roleName
  11 + required: true
  12 + - ref: desc
  13 + required: false
  14 + result:
  15 + - name: role
  16 + type:
  17 + schema: role
  18 + required: true
  1 +version: v1
  2 +kind: Service
  3 +metadata:
  4 + name: role
  5 + description: 角色管理
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: check
  5 + type: command
  6 + description: 密码检查
  7 + payload:
  8 + - ref: usersId
  9 + required: true
  10 + - ref: phone
  11 + required: true
  12 + - ref: password
  13 + required: true
  14 + result:
  15 + - name: users
  16 + type:
  17 + schema: users
  18 + required: true
@@ -5,38 +5,20 @@ metadata: @@ -5,38 +5,20 @@ metadata:
5 type: command 5 type: command
6 description: 创建用户信息 6 description: 创建用户信息
7 payload: 7 payload:
8 - - ref: usersCode 8 + - ref: usersId
9 required: true 9 required: true
10 - - name: organizationId  
11 - description: 组织机构 10 + - name: usersInfo
  11 + description: 用户信息
12 type: 12 type:
13 - primitive: int64  
14 - required: true  
15 - - name: departmentId  
16 - description: 所属部门  
17 - type:  
18 - primitive: int64  
19 - required: true  
20 - - name: usersOrg  
21 - description: 用户关联的组织 13 + schema: usersInfo
  14 + - name: phoneAuth
  15 + description: 手机认证
22 type: 16 type:
23 - array: int64  
24 - required: false  
25 - - name: usersRole  
26 - description: 用户关联的角色 17 + schemal: phoneAuth
  18 + - name: im
  19 + description: IM信息
27 type: 20 type:
28 - array: int64  
29 - required: false  
30 - - ref: enableStatus  
31 - required: true  
32 - - ref: usersName  
33 - required: true  
34 - - ref: phone  
35 - required: true  
36 - - ref: avator  
37 - required: false  
38 - - ref: email  
39 - required: false 21 + schemal: im
40 result: 22 result:
41 - name: users 23 - name: users
42 type: 24 type:
@@ -12,7 +12,7 @@ metadata: @@ -12,7 +12,7 @@ metadata:
12 result: 12 result:
13 - ref: count 13 - ref: count
14 required: true 14 required: true
15 - - name: userss 15 + - name: users
16 type: 16 type:
17 array: users 17 array: users
18 required: true 18 required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: phoneAuth
  5 + type: command
  6 + description: 手机认证
  7 + payload:
  8 + - ref: usersId
  9 + required: true
  10 + - ref: phone
  11 + required: true
  12 + - ref: password
  13 + required: true
  14 + result:
  15 + - name: users
  16 + type:
  17 + schema: users
  18 + required: true
@@ -7,36 +7,18 @@ metadata: @@ -7,36 +7,18 @@ metadata:
7 payload: 7 payload:
8 - ref: usersId 8 - ref: usersId
9 required: true 9 required: true
10 - - name: organizationId  
11 - description: 组织机构 10 + - name: usersInfo
  11 + description: 用户信息
12 type: 12 type:
13 - primitive: int64  
14 - required: true  
15 - - name: departmentId  
16 - description: 所属部门  
17 - type:  
18 - primitive: int64  
19 - required: true  
20 - - name: usersOrg  
21 - description: 用户关联的组织 13 + schema: usersInfo
  14 + - name: phoneAuth
  15 + description: 手机认证
22 type: 16 type:
23 - array: int64  
24 - required: false  
25 - - name: usersRole  
26 - description: 用户关联的角色 17 + schemal: phoneAuth
  18 + - name: im
  19 + description: IM信息
27 type: 20 type:
28 - array: int64  
29 - required: false  
30 - - ref: enableStatus  
31 - required: true  
32 - - ref: usersName  
33 - required: true  
34 - - ref: phone  
35 - required: true  
36 - - ref: avator  
37 - required: false  
38 - - ref: email  
39 - required: false 21 + schemal: im
40 result: 22 result:
41 - name: users 23 - name: users
42 type: 24 type:
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: batchAdd
  5 + type: command
  6 + description: 批量添加
  7 + payload:
  8 + - ref: usersType
  9 + required: true
  10 + - name: users
  11 + description: 用户列表
  12 + type:
  13 + array: usersCompany
  14 + result:
  15 + - name: count
  16 + type:
  17 + primitive: int
  18 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: batchEnable
  5 + type: command
  6 + description: 批量修改启用状态
  7 + payload:
  8 + - name: usersCompanyIds
  9 + type:
  10 + array: int64
  11 + required: true
  12 + - ref: enableStatus
  13 + required: true
  14 + result:
  15 + - name: usersCompany
  16 + type:
  17 + schema: usersCompany
  18 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: batchResetPassword
  5 + type: command
  6 + description: 批量重置密码
  7 + payload:
  8 + - name: usersCompanyIds
  9 + type:
  10 + array: int64
  11 + required: true
  12 + - ref: password
  13 + required: true
  14 + result:
  15 + - name: usersCompany
  16 + type:
  17 + schema: usersCompany
  18 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: createUsersCompany
  5 + type: command
  6 + description: 创建企业用户管理
  7 + payload:
  8 + - ref: companyId
  9 + required: true
  10 + - ref: usersType
  11 + required: true
  12 + - ref: usersCode
  13 + required: true
  14 + - name: organizationId
  15 + description: 组织机构
  16 + type:
  17 + primitive: int64
  18 + required: true
  19 + - name: departmentId
  20 + description: 所属部门
  21 + type:
  22 + primitive: int64
  23 + required: true
  24 + - name: usersOrg
  25 + description: 用户关联的组织
  26 + type:
  27 + array: int64
  28 + required: false
  29 + - name: usersRole
  30 + description: 用户关联的角色
  31 + type:
  32 + array: int64
  33 + required: false
  34 + - name: cooperationInfo
  35 + description: 共创信息 (共创用户有效)
  36 + type:
  37 + schema: cooperationInfo
  38 + required: false
  39 + - ref: enableStatus
  40 + required: true
  41 + - ref: usersName
  42 + required: true
  43 + - ref: phone
  44 + required: true
  45 + - ref: avator
  46 + required: false
  47 + - ref: email
  48 + required: false
  49 + result:
  50 + - name: usersCompany
  51 + type:
  52 + schema: usersCompany
  53 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: getUsersCompany
  5 + type: query
  6 + description: 返回企业用户管理
  7 + payload:
  8 + - ref: usersCompanyId
  9 + required: true
  10 + result:
  11 + - name: usersCompany
  12 + type:
  13 + schema: usersCompany
  14 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: listUsersCompany
  5 + type: query
  6 + description: 返回企业用户管理列表
  7 + payload:
  8 + - ref: offset
  9 + required: true
  10 + - ref: limit
  11 + required: true
  12 + - ref: userName
  13 + required: false
  14 + - ref: depName
  15 + required: false
  16 + - name: cooperationCompany
  17 + type:
  18 + primitive: string
  19 + required: false
  20 + result:
  21 + - ref: count
  22 + required: true
  23 + - name: usersCompanys
  24 + type:
  25 + array: usersCompany
  26 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: removeUsersCompany
  5 + type: command
  6 + description: 移除企业用户管理
  7 + payload:
  8 + - ref: usersCompanyId
  9 + required: true
  10 + result:
  11 + - name: usersCompany
  12 + type:
  13 + schema: usersCompany
  14 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: updateUsersCompany
  5 + type: command
  6 + description: 更新企业用户管理
  7 + payload:
  8 + - ref: usersCompanyId
  9 + required: true
  10 + - name: organizationId
  11 + description: 组织机构
  12 + type:
  13 + primitive: int64
  14 + required: true
  15 + - name: departmentId
  16 + description: 所属部门
  17 + type:
  18 + primitive: int64
  19 + required: true
  20 + - name: usersOrg
  21 + description: 用户关联的组织
  22 + type:
  23 + array: int64
  24 + required: false
  25 + - name: usersRole
  26 + description: 用户关联的角色
  27 + type:
  28 + array: int64
  29 + required: false
  30 + - name: cooperationInfo
  31 + description: 共创信息 (共创用户有效)
  32 + type:
  33 + schema: cooperationInfo
  34 + required: false
  35 + - ref: enableStatus
  36 + required: true
  37 + - ref: usersName
  38 + required: true
  39 + - ref: phone
  40 + required: true
  41 + - ref: avator
  42 + required: false
  43 + - ref: email
  44 + required: false
  45 + result:
  46 + - name: usersCompany
  47 + type:
  48 + schema: usersCompany
  49 + required: true
  1 +version: v1
  2 +kind: Service
  3 +metadata:
  4 + name: usersCompany
  5 + description: 企业用户管理
@@ -48,8 +48,8 @@ type Menu struct { @@ -48,8 +48,8 @@ type Menu struct {
48 ParentPath string `json:"parentPath"` 48 ParentPath string `json:"parentPath"`
49 // 菜单是否公开状态,[0:隐藏],[1:显示],默认显示 49 // 菜单是否公开状态,[0:隐藏],[1:显示],默认显示
50 IsPublish int `json:"isPublish"` 50 IsPublish int `json:"isPublish"`
51 - // 菜单是否是系统级,[0:否],[1:是],默认否  
52 - IsSystem int `json:"isSystem"` 51 + // 启用状态(启用:1 禁用:0),默认启用
  52 + EnableStatus int `json:"enableStatus"`
53 } 53 }
54 54
55 type MenuRepository interface { 55 type MenuRepository interface {
@@ -100,8 +100,8 @@ func (menu *Menu) Update(data map[string]interface{}) error { @@ -100,8 +100,8 @@ func (menu *Menu) Update(data map[string]interface{}) error {
100 if isPublish, ok := data["isPublish"]; ok { 100 if isPublish, ok := data["isPublish"]; ok {
101 menu.IsPublish = isPublish.(int) 101 menu.IsPublish = isPublish.(int)
102 } 102 }
103 - if isSystem, ok := data["isSystem"]; ok {  
104 - menu.IsSystem = isSystem.(int) 103 + if enableStatus, ok := data["enableStatus"]; ok {
  104 + menu.EnableStatus = enableStatus.(int)
105 } 105 }
106 return nil 106 return nil
107 } 107 }
@@ -26,6 +26,6 @@ type Menu struct { @@ -26,6 +26,6 @@ type Menu struct {
26 ParentPath string 26 ParentPath string
27 // 菜单是否公开状态,[0:隐藏],[1:显示],默认显示 27 // 菜单是否公开状态,[0:隐藏],[1:显示],默认显示
28 IsPublish int 28 IsPublish int
29 - // 菜单是否是系统级,[0:否],[1:是],默认否  
30 - IsSystem int 29 + // 启用状态(启用:1 禁用:0),默认启用
  30 + EnableStatus int
31 } 31 }
@@ -7,18 +7,18 @@ import ( @@ -7,18 +7,18 @@ import (
7 7
8 func TransformToMenuDomainModelFromPgModels(menuModel *models.Menu) (*domain.Menu, error) { 8 func TransformToMenuDomainModelFromPgModels(menuModel *models.Menu) (*domain.Menu, error) {
9 return &domain.Menu{ 9 return &domain.Menu{
10 - MenuId: menuModel.MenuId,  
11 - ParentId: menuModel.ParentId,  
12 - MenuName: menuModel.MenuName,  
13 - Code: menuModel.Code,  
14 - AccessCode: menuModel.AccessCode,  
15 - MenuType: menuModel.MenuType,  
16 - Icon: menuModel.Icon,  
17 - Sort: menuModel.Sort,  
18 - Remark: menuModel.Remark,  
19 - Category: menuModel.Category,  
20 - ParentPath: menuModel.ParentPath,  
21 - IsPublish: menuModel.IsPublish,  
22 - IsSystem: menuModel.IsSystem, 10 + MenuId: menuModel.MenuId,
  11 + ParentId: menuModel.ParentId,
  12 + MenuName: menuModel.MenuName,
  13 + Code: menuModel.Code,
  14 + AccessCode: menuModel.AccessCode,
  15 + MenuType: menuModel.MenuType,
  16 + Icon: menuModel.Icon,
  17 + Sort: menuModel.Sort,
  18 + Remark: menuModel.Remark,
  19 + Category: menuModel.Category,
  20 + ParentPath: menuModel.ParentPath,
  21 + IsPublish: menuModel.IsPublish,
  22 + EnableStatus: menuModel.EnableStatus,
23 }, nil 23 }, nil
24 } 24 }
@@ -38,7 +38,7 @@ func (repository *MenuRepository) Save(menu *domain.Menu) (*domain.Menu, error) @@ -38,7 +38,7 @@ func (repository *MenuRepository) Save(menu *domain.Menu) (*domain.Menu, error)
38 "category", 38 "category",
39 "parent_path", 39 "parent_path",
40 "is_publish", 40 "is_publish",
41 - "is_system", 41 + "enable_status",
42 } 42 }
43 insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlbuilder.RemoveSqlFields(sqlBuildFields, "menu_id")) 43 insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlbuilder.RemoveSqlFields(sqlBuildFields, "menu_id"))
44 insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlbuilder.RemoveSqlFields(sqlBuildFields, "menu_id")) 44 insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlbuilder.RemoveSqlFields(sqlBuildFields, "menu_id"))
@@ -67,7 +67,7 @@ func (repository *MenuRepository) Save(menu *domain.Menu) (*domain.Menu, error) @@ -67,7 +67,7 @@ func (repository *MenuRepository) Save(menu *domain.Menu) (*domain.Menu, error)
67 &menu.Category, 67 &menu.Category,
68 &menu.ParentPath, 68 &menu.ParentPath,
69 &menu.IsPublish, 69 &menu.IsPublish,
70 - &menu.IsSystem, 70 + &menu.EnableStatus,
71 ), 71 ),
72 fmt.Sprintf("INSERT INTO users.menu (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet), 72 fmt.Sprintf("INSERT INTO users.menu (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
73 menu.ParentId, 73 menu.ParentId,
@@ -81,7 +81,7 @@ func (repository *MenuRepository) Save(menu *domain.Menu) (*domain.Menu, error) @@ -81,7 +81,7 @@ func (repository *MenuRepository) Save(menu *domain.Menu) (*domain.Menu, error)
81 menu.Category, 81 menu.Category,
82 menu.ParentPath, 82 menu.ParentPath,
83 menu.IsPublish, 83 menu.IsPublish,
84 - menu.IsSystem, 84 + menu.EnableStatus,
85 ); err != nil { 85 ); err != nil {
86 return menu, err 86 return menu, err
87 } 87 }
@@ -100,7 +100,7 @@ func (repository *MenuRepository) Save(menu *domain.Menu) (*domain.Menu, error) @@ -100,7 +100,7 @@ func (repository *MenuRepository) Save(menu *domain.Menu) (*domain.Menu, error)
100 &menu.Category, 100 &menu.Category,
101 &menu.ParentPath, 101 &menu.ParentPath,
102 &menu.IsPublish, 102 &menu.IsPublish,
103 - &menu.IsSystem, 103 + &menu.EnableStatus,
104 ), 104 ),
105 fmt.Sprintf("UPDATE users.menu SET %s WHERE menu_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet), 105 fmt.Sprintf("UPDATE users.menu SET %s WHERE menu_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
106 menu.ParentId, 106 menu.ParentId,
@@ -114,7 +114,7 @@ func (repository *MenuRepository) Save(menu *domain.Menu) (*domain.Menu, error) @@ -114,7 +114,7 @@ func (repository *MenuRepository) Save(menu *domain.Menu) (*domain.Menu, error)
114 menu.Category, 114 menu.Category,
115 menu.ParentPath, 115 menu.ParentPath,
116 menu.IsPublish, 116 menu.IsPublish,
117 - menu.IsSystem, 117 + menu.EnableStatus,
118 menu.Identify(), 118 menu.Identify(),
119 ); err != nil { 119 ); err != nil {
120 return menu, err 120 return menu, err
@@ -15,7 +15,7 @@ var _ = Describe("返回菜单服务", func() { @@ -15,7 +15,7 @@ var _ = Describe("返回菜单服务", func() {
15 BeforeEach(func() { 15 BeforeEach(func() {
16 _, err := pG.DB.QueryOne( 16 _, err := pG.DB.QueryOne(
17 pg.Scan(&menuId), 17 pg.Scan(&menuId),
18 - "INSERT INTO users.menu (menu_id, parent_id, menu_name, code, access_code, menu_type, icon, sort, remark, category, parent_path, is_publish, is_system) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING menu_id", 18 + "INSERT INTO users.menu (menu_id, parent_id, menu_name, code, access_code, menu_type, icon, sort, remark, category, parent_path, is_publish, enable_status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING menu_id",
19 1, 0, "testMenuName", "testCode", "testAccessCode", "testMenuType", "testIcon", 1, "testDesc", "testCategory", "testParentPath", 1, 1) 19 1, 0, "testMenuName", "testCode", "testAccessCode", "testMenuType", "testIcon", 1, "testDesc", "testCategory", "testParentPath", 1, 1)
20 Expect(err).NotTo(HaveOccurred()) 20 Expect(err).NotTo(HaveOccurred())
21 }) 21 })
@@ -15,7 +15,7 @@ var _ = Describe("返回菜单服务列表", func() { @@ -15,7 +15,7 @@ var _ = Describe("返回菜单服务列表", func() {
15 BeforeEach(func() { 15 BeforeEach(func() {
16 _, err := pG.DB.QueryOne( 16 _, err := pG.DB.QueryOne(
17 pg.Scan(&menuId), 17 pg.Scan(&menuId),
18 - "INSERT INTO users.menu (menu_id, parent_id, menu_name, code, access_code, menu_type, icon, sort, remark, category, parent_path, is_publish, is_system) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING menu_id", 18 + "INSERT INTO users.menu (menu_id, parent_id, menu_name, code, access_code, menu_type, icon, sort, remark, category, parent_path, is_publish, enable_status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING menu_id",
19 1, 0, "testMenuName", "testCode", "testAccessCode", "testMenuType", "testIcon", 1, "testDesc", "testCategory", "testfullPath", 1, 1) 19 1, 0, "testMenuName", "testCode", "testAccessCode", "testMenuType", "testIcon", 1, "testDesc", "testCategory", "testfullPath", 1, 1)
20 Expect(err).NotTo(HaveOccurred()) 20 Expect(err).NotTo(HaveOccurred())
21 }) 21 })
@@ -15,7 +15,7 @@ var _ = Describe("移除菜单服务", func() { @@ -15,7 +15,7 @@ var _ = Describe("移除菜单服务", func() {
15 BeforeEach(func() { 15 BeforeEach(func() {
16 _, err := pG.DB.QueryOne( 16 _, err := pG.DB.QueryOne(
17 pg.Scan(&menuId), 17 pg.Scan(&menuId),
18 - "INSERT INTO users.menu (menu_id, parent_id, menu_name, code, access_code, menu_type, icon, sort, remark, category, parent_path, is_publish, is_system) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING menu_id", 18 + "INSERT INTO users.menu (menu_id, parent_id, menu_name, code, access_code, menu_type, icon, sort, remark, category, parent_path, is_publish, enable_status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING menu_id",
19 1, 0, "testMenuName", "testCode", "testAccessCode", "testMenuType", "testIcon", 1, "testDesc", "testCategory", "testfullPath", 1, 1) 19 1, 0, "testMenuName", "testCode", "testAccessCode", "testMenuType", "testIcon", 1, "testDesc", "testCategory", "testfullPath", 1, 1)
20 Expect(err).NotTo(HaveOccurred()) 20 Expect(err).NotTo(HaveOccurred())
21 }) 21 })
@@ -15,7 +15,7 @@ var _ = Describe("更新菜单服务", func() { @@ -15,7 +15,7 @@ var _ = Describe("更新菜单服务", func() {
15 BeforeEach(func() { 15 BeforeEach(func() {
16 _, err := pG.DB.QueryOne( 16 _, err := pG.DB.QueryOne(
17 pg.Scan(&menuId), 17 pg.Scan(&menuId),
18 - "INSERT INTO users.menu (menu_id, parent_id, menu_name, code, access_code, menu_type, icon, sort, remark, category, parent_path, is_publish, is_system) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING menu_id", 18 + "INSERT INTO users.menu (menu_id, parent_id, menu_name, code, access_code, menu_type, icon, sort, remark, category, parent_path, is_publish, enable_status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING menu_id",
19 1, 0, "testMenuName", "testCode", "testAccessCode", "testMenuType", "testIcon", 1, "testDesc", "testCategory", "testfullPath", 1, 1) 19 1, 0, "testMenuName", "testCode", "testAccessCode", "testMenuType", "testIcon", 1, "testDesc", "testCategory", "testfullPath", 1, 1)
20 Expect(err).NotTo(HaveOccurred()) 20 Expect(err).NotTo(HaveOccurred())
21 }) 21 })