作者 yangfu

add role api

version: v1
kind: HttpApi
metadata:
service: org
path: /orgs
endpoints:
- method: createOrg
route:
post: /
- method: updateOrg
route:
put: /{orgId}
- method: getOrg
route:
get: /{orgId}
- method: removeOrg
route:
delete: /{orgId}
- method: listOrg
route:
get: /
params:
- name: offset
- name: limit
- name: companyId
- name: orgCode
- name: depName
- name: parentId
- name: isOrg
- method: getOrgSubDepartment
route:
get: /{orgId}/sub-department
params:
- name: orgId
- name: childFlag
\ No newline at end of file
... ...
version: v1
kind: HttpApi
metadata:
service: role
path: /roles
endpoints:
- method: createRole
route:
post: /
- method: updateRole
route:
put: /{roleId}
- method: getRole
route:
get: /{roleId}
- method: removeRole
route:
delete: /{roleId}
- method: listRole
route:
get: /
params:
- name: offset
- name: limit
- method: getRoleRelatedUsers
route:
get: /{roleId}/related-users
params:
- name: roleId
- name: orgId
- name: departmentId
- method: getRoleAccessMenus
route:
get: /{roleId}/access-menus
params:
- name: roleId
- method: assginRoleToUsers
route:
post: /assgin
- method: unAssginRoleToUsers
route:
post: /unassgin
- method: updateRoleAccessMenus
route:
put: /{roleId}/access-menus
\ No newline at end of file
... ...
version: v1
kind: Attribute
metadata:
name: departmentId
description: 部门编号
type:
primitive: int64
... ...
... ... @@ -26,3 +26,8 @@ metadata:
required: true
- ref: parentId
required: true
- name: parentPath
description: 父级节点路径("0,11,12,")
type:
primitive: string
required: false
\ No newline at end of file
... ...
version: v1
kind: Method
metadata:
name: getOrgSubDepartment
type: query
description: 获取组织的子部门(通用部门列表使用)
payload:
- ref: orgId
required: true
- name: childFlag
description: 获取所有子节点 (1:获取当前下级子节点 2:获取当前下级所有子节点)
type:
primitive: int
result:
- name: org
type:
schema: org
required: true
... ...
... ... @@ -6,8 +6,10 @@ metadata:
description: 返回组织管理列表
payload:
- ref: offset
required: true
required: false
- ref: limit
required: false
- ref: companyId
required: true
- ref: orgCode
required: false
... ... @@ -17,8 +19,6 @@ metadata:
required: false
- ref: isOrg
required: false
- ref: companyId
required: true
result:
- ref: count
required: true
... ...
version: v1
kind: Method
metadata:
name: assginRoleToUsers
type: command
description: 分配角色给多个用户
payload:
- ref: roleId
required: true
- name: usersIds
description: 用户列表
type:
array: int64
result:
- name: code
type:
primitive: int
required: true
- name: msg
type:
primitive: string
required: true
... ...
version: v1
kind: Method
metadata:
name: getRoleAccessMenus
type: query
description: 获取角色菜单
payload:
- ref: roleId
required: true
result:
- name: accessMenus
type:
array: int64
required: true
... ...
version: v1
kind: Method
metadata:
name: getRoleRelatedUsers
type: query
description: 获取角色相关联的用户
payload:
- ref: roleId
required: true
- ref: orgId
required: false
- ref: departmentId
required: false
result:
- name: role
type:
schema: role
required: true
... ...
... ... @@ -13,6 +13,8 @@ metadata:
required: false
- ref: orgName
required: false
- ref: orgId
required: false
- name: inOrgIds
description: 匹配多个组织 1,2,3 逗号分割 inOrgIds
required: false
... ...
version: v1
kind: Method
metadata:
name: unAssginRoleToUsers
type: command
description: 取消用户分配的角色
payload:
- ref: roleId
required: true
- name: usersIds
description: 用户列表
type:
array: int64
result:
- name: code
type:
primitive: int
required: true
- name: msg
type:
primitive: string
required: true
... ...
version: v1
kind: Method
metadata:
name: setRoleAccessMenus
type: command
description: 角色设置菜单
payload:
- ref: roleId
required: true
- name: accessMenus
description: 菜单编号列表
type:
array: int64
result:
- name: role
type:
schema: role
required: true
... ...
... ... @@ -18,7 +18,7 @@ metadata:
result:
- ref: count
required: true
- name: userss
- name: users
type:
array: users
required: true
... ...