作者 tangxuhui

角色关联部分

  1 +version: v1
  2 +kind: HttpApi
  3 +metadata:
  4 + service: roles
  5 + path: /roles
  6 + endpoints:
  7 + - method: roleAdd
  8 + route:
  9 + post: /
  10 + - method: roleUpdate
  11 + route:
  12 + put: /{Id}
  13 + - method: roleList
  14 + route:
  15 + post: /search
  16 + - method: roleGet
  17 + route:
  18 + get: /{Id}
  19 + - method: roleUserInfo
  20 + route:
  21 + get: /role-user/{Id}
  22 + - method: roleUserAdd
  23 + route:
  24 + post: /role-user
  25 + - method: roleUserDelete
  26 + route:
  27 + delete: /role-user
  28 + - method: roleUserBeforeEdit
  29 + route:
  30 + get: /role-user/before-edit
  31 + - method: roleMenuBeforeEdit
  32 + route:
  33 + get: /role-menu/before-edit
  34 + - method: roleMenuEdit
  35 + route:
  36 + put: /role-menu/{Id}
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: createdAt
  5 + description: 创建时间
  6 + type:
  7 + primitive: datetime
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: deletedAt
  5 + description: 删除时间
  6 + type:
  7 + primitive: datetime
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: updatedAt
  5 + description: 更新时间
  6 + type:
  7 + primitive: datetime
@@ -3,5 +3,5 @@ kind: Attribute @@ -3,5 +3,5 @@ kind: Attribute
3 metadata: 3 metadata:
4 name: accessMenus 4 name: accessMenus
5 description: 有权限的菜单 5 description: 有权限的菜单
6 - type:  
7 - primitive: int64 6 + type:
  7 + array: int64
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: roleDetail
  5 + description: 角色详细数据
  6 + attributes:
  7 + - ref: roleId
  8 + required: true
  9 + - ref: companyId
  10 + required: true
  11 + - ref: orgId
  12 + required: true
  13 + - ref: orgName
  14 + required: true
  15 + - ref: roleName
  16 + required: true
  17 + - ref: desc
  18 + required: true
  19 + - name: roleMenu
  20 + description: 角色拥有的权限菜单
  21 + type:
  22 + array: roleMenu
  23 + - name: roleUser
  24 + description: 关联的用户
  25 + type:
  26 + array: roleUser
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: role
  5 + description: 角色 (base)
  6 + attributes:
  7 + - ref: roleId
  8 + required: true
  9 + - ref: orgId
  10 + required: true
  11 + - ref: orgName
  12 + required: true
  13 + - ref: roleName
  14 + required: true
  15 + - ref: desc
  16 + required: true
  17 + - ref: createdAt
  18 + required: true
  19 + - ref: updatedAt
  20 + required: true
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: roleMenu
  5 + description: 角色下拥有的菜单
  6 + attributes:
  7 + - ref: menuId
  8 + required: true
  9 + - ref: parentId
  10 + required: true
  11 + - ref: menuName
  12 + required: true
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: roleUser
  5 + description: 角色下关联的用户
  6 + attributes:
  7 + - ref: usersId
  8 + required: true
  9 + - ref: usersCode
  10 + required: true
  11 + - ref: usersName
  12 + required: true
  13 + - ref: orgId
  14 + required: true
  15 + - ref: orgName
  16 + required: true
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: roleUserInfo
  5 + description: 角色下关联用户的详情
  6 + attributes:
  7 + - ref: roleId
  8 + required: true
  9 + - ref: roleName
  10 + required: true
  11 + - ref: desc
  12 + required: true
  13 + - name: roleUser
  14 + description: 关联的用户
  15 + type:
  16 + array: roleUser
  17 + - name: notInRoleUser
  18 + description: 未关联的用户列表
  19 + type:
  20 + array: roleUser
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: roleAdd
  5 + type: command
  6 + description: 创建role
  7 + payload:
  8 + - name: role
  9 + type:
  10 + schema: role
  11 + required: true
  12 + result:
  13 + - name: role
  14 + type:
  15 + schema: role
  16 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: roleGet
  5 + type: query
  6 + description: 返角色详情
  7 + payload:
  8 + - ref: roleId
  9 + required: true
  10 + result:
  11 + - name: role
  12 + type:
  13 + schema: roleDetail
  14 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: roleList
  5 + type: query
  6 + description: 返回role列表
  7 + payload:
  8 + - ref: offset
  9 + required: true
  10 + - ref: limit
  11 + required: true
  12 + result:
  13 + - ref: count
  14 + required: true
  15 + - name: roles
  16 + type:
  17 + array: role
  18 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: roleMenuBeforeEdit
  5 + type: query
  6 + description: 编辑角色关联权限菜单的前置准备数据
  7 + payload:
  8 + - ref: roleId
  9 + required: true
  10 + result:
  11 + - name: roles
  12 + type:
  13 + array: role
  14 + required: true
  15 + - name: menus
  16 + type:
  17 + array: menu
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: roleMenuEdit
  5 + type: query
  6 + description: 角色编辑关联菜单权限
  7 + payload:
  8 + - ref: roleId
  9 + required: true
  10 + - name: menuId
  11 + description: 关联菜单的id
  12 + type:
  13 + array: int64
  14 + result:
  15 + - ref: roleId
  16 + required: true
  17 + - name: menuId
  18 + description: 关联菜单的id
  19 + type:
  20 + array: int64
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: roleRemove
  5 + type: command
  6 + description: 移除role
  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: roleUpdate
  5 + type: command
  6 + description: 更新role
  7 + payload:
  8 + - name: role
  9 + type:
  10 + schema: role
  11 + required: true
  12 + result:
  13 + - name: role
  14 + type:
  15 + schema: role
  16 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: roleUserAdd
  5 + type: query
  6 + description: 角色添加关联用户
  7 + payload:
  8 + - ref: roleId
  9 + required: true
  10 + - name: userId
  11 + description: 关联用户的id
  12 + type:
  13 + array: int64
  14 + result:
  15 + - ref: roleId
  16 + required: true
  17 + - name: userId
  18 + description: 关联用户的id
  19 + type:
  20 + array: int64
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: roleUserBeforeEdit
  5 + type: query
  6 + description: 编辑角色关联用户的前置准备数据
  7 + result:
  8 + - name: roles
  9 + type:
  10 + array: role
  11 + required: true
  12 + - name: orgs
  13 + type:
  14 + array: org
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: roleUserDelete
  5 + type: query
  6 + description: 角色添加关联用户
  7 + payload:
  8 + - ref: roleId
  9 + required: true
  10 + - name: userId
  11 + description: 关联用户的id
  12 + type:
  13 + array: int64
  14 + result:
  15 + - ref: roleId
  16 + required: true
  17 + - name: userId
  18 + description: 关联用户的id
  19 + type:
  20 + array: int64
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: roleUserInfo
  5 + type: query
  6 + description: 角色下关联用户的数据
  7 + payload:
  8 + - ref: roleId
  9 + required: true
  10 + result:
  11 + - name: roleUser
  12 + description: 关联详情
  13 + type:
  14 + schema: roleUserInfo
  1 +version: v1
  2 +kind: Service
  3 +metadata:
  4 + name: roles
  5 + description: roles