From: 刘洪青 Date: Thu, 5 Nov 2020 08:14:07 +0000 (+0800) Subject: docs: poa 文档,新增接口:获取应用下的一个角色关联的用户组 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=bd15b947d7098cbe56e75a7a490141237a5e0fa8;p=institute%2Fdeploy-authx-service.git docs: poa 文档,新增接口:获取应用下的一个角色关联的用户组 --- diff --git a/poa-api-docs/api-docs/user-authorization-service-poa.v1.yaml b/poa-api-docs/api-docs/user-authorization-service-poa.v1.yaml index 236e049..c7f4b87 100644 --- a/poa-api-docs/api-docs/user-authorization-service-poa.v1.yaml +++ b/poa-api-docs/api-docs/user-authorization-service-poa.v1.yaml @@ -1,16 +1,16 @@ # user-authorization-service-poa.v1.yaml # # 1. 创建服务 -# curl -i -s -X POST 'https://poa-sa.dev.supwisdom.com/v1/services' -H 'Content-Type: application/json' -d '{"id": "authz", "origin": "http://user-authorization-poa-svc.user-authorization-service.svc.cluster.local:8080", "name": "授权服务", "description": "授权服务"}' +# curl -i -s -X POST 'https://poa-sa.supwisdom.com/v1/services' -H 'Content-Type: application/json' -d '{"id": "authz", "origin": "http://user-authorization-poa-svc.user-authorization-service.svc.cluster.local:8080", "name": "授权服务", "description": "授权服务"}' # # 2. 创建版本 -# curl -i -s -X POST 'https://poa-sa.dev.supwisdom.com/v1/services/authz/apiVersions/v1' +# curl -i -s -X POST 'https://poa-sa.supwisdom.com/v1/services/authz/apiVersions/v1' # # 3. 上传OAS Yaml -# curl -i -s -X POST 'https://poa-sa.dev.supwisdom.com/v1/services/authz/apiVersions/v1/apiSpecs' -H 'Content-Type: application/yaml' --data-binary @user-authorization-service-poa.v1.yaml +# curl -i -s -X POST 'https://poa-sa.supwisdom.com/v1/services/authz/apiVersions/v1/apiSpecs' -H 'Content-Type: application/yaml' --data-binary @user-authorization-service-poa.v1.yaml # # 4. 发布版本 -# curl -i -s -X POST 'https://poa-sa.dev.supwisdom.com/v1/services/authz/apiVersions/v1/publish' +# curl -i -s -X POST 'https://poa-sa.supwisdom.com/v1/services/authz/apiVersions/v1/publish' # openapi: 3.0.2 info: @@ -183,7 +183,7 @@ paths: format: int32 default: 1000 requestBody: - description: 角色IDs + description: 角色ID required: true content: application/json: @@ -202,6 +202,47 @@ paths: default: $ref: '#/components/responses/DefaultErrorResponse' + + '/application/{applicationId}/role/{rolecode}/groups': + get: + summary: 获取应用下的一个角色关联的用户组 + description: 获取应用下的一个角色关联的用户组 + operationId: loadApplicationRoleGroups + tags: + - Role + security: + - oauth2: + - "authz:v1:readRole" + parameters: + - name: applicationId + in: path + required: true + description: 应用标识 + schema: + type: string + - name: rolecode + in: path + required: true + description: 角色代码 + schema: + type: string + - name: groupType + in: path + required: false + description: 用户组类型(1 普通,2 岗位) + schema: + type: string + responses: + '200': + description: 角色关联的用户组列表 + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationRoleGroupsResponse' + default: + $ref: '#/components/responses/DefaultErrorResponse' + + components: # Security Schemes @@ -310,6 +351,9 @@ components: - type: object title: 实体属性 properties: + applicationId: + title: 所属应用 + type: string code: title: 代码 type: string @@ -326,6 +370,43 @@ components: title: 扩展ID type: string + + GroupModel: + title: 模型 - 用户组 + allOf: + - type: object + title: 实体属性 + properties: + id: + title: ID + type: string + applicationId: + title: 所属应用 + type: string + code: + title: 代码 + type: string + name: + title: 名称 + type: string + description: + title: 描述 + type: string + type: + title: 类型,1 普通用户组,2 岗位用户组 + type: string + state: + title: 状态,0:正常 1:冻结 2:注销 + type: integer + format: int32 + sort: + title: 排序 + type: integer + format: int32 + common: + title: 是否公共 + type: boolean + # Request VO @@ -457,3 +538,34 @@ components: items: title: 用户的帐号ID type: string + + + ApplicationRoleGroupsResponse: + allOf: + - $ref: '#/components/schemas/DefaultApiResponse' + - type: object + title: 响应数据 + properties: + data: + allOf: + - type: object + title: 数据 + properties: + applicationId: + title: 应用标识 + type: string + rolecode: + title: 角色代码 + type: string + groupIds: + title: 用户组ID列表 + type: array + items: + title: 用户组ID + type: string + groups: + title: 用户组列表 + type: array + items: + $ref: '#/components/schemas/GroupModel' +