From: 刘洪青 Date: Mon, 14 Dec 2020 05:33:58 +0000 (+0800) Subject: fix: 更新授权服务,开放接口yaml文档 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=103e72464e3758717bb64ebdd5818d32a2698492;p=institute%2Fdeploy-authx-service.git fix: 更新授权服务,开放接口yaml文档 --- 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 c1be9d3..aa27cdf 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 @@ -142,11 +142,11 @@ paths: default: $ref: '#/components/responses/DefaultErrorResponse' - '/application/{applicationId}/roles/accounts': - post: - summary: 获取应用下的多个角色的用户帐号 - description: 获取应用下的多个角色的用户帐号 - operationId: loadAccountsByApplicationRole + '/application/{applicationId}/role/{rolecode}/groups': + get: + summary: 获取应用下的一个角色关联的用户组 + description: 获取应用下的一个角色关联的用户组 + operationId: loadApplicationRoleGroups tags: - Role security: @@ -159,6 +159,52 @@ paths: 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' + + + '/application/{applicationId}/externalRole/{externalId}/accounts': + get: + summary: 获取应用下的一个角色的用户帐号 + description: 获取应用下的一个角色的用户帐号 + operationId: loadAccountsByApplicationExternalRole + tags: + - Role + security: + - oauth2: + - "authz:v1:readRole" + parameters: + - name: applicationId + in: path + required: true + description: 应用标识 + schema: + type: string + - name: externalId + in: path + required: true + description: 应用内角色ID + schema: + type: string - name: loadAll in: query required: false @@ -182,32 +228,21 @@ paths: type: integer format: int32 default: 1000 - requestBody: - description: 角色ID - required: true - content: - application/json: - schema: - type: array - items: - title: 角色ID - type: string responses: '200': - description: 用户的帐号ID + description: 角色关联的帐号ID content: application/json: schema: - $ref: '#/components/schemas/ApplicationRolesAccountsResponse' + $ref: '#/components/schemas/ApplicationExternalRoleAccountsResponse' default: $ref: '#/components/responses/DefaultErrorResponse' - - '/application/{applicationId}/role/{rolecode}/groups': - get: - summary: 获取应用下的一个角色关联的用户组 - description: 获取应用下的一个角色关联的用户组 - operationId: loadApplicationRoleGroups + '/application/{applicationId}/externalRoles/accounts': + post: + summary: 获取应用下的多个角色的用户帐号 + description: 获取应用下的多个角色的用户帐号 + operationId: loadAccountsByApplicationExternalRoles tags: - Role security: @@ -220,25 +255,46 @@ paths: description: 应用标识 schema: type: string - - name: rolecode - in: path - required: true - description: 角色代码 + - name: loadAll + in: query + required: false + description: 分页-是否返回所有(当为 true 时,不分页,参数 pageIndex、pageSize 无效) schema: - type: string - - name: groupType - in: path + type: boolean + default: false + - name: pageIndex + in: query required: false - description: 用户组类型(1 普通,2 岗位) + description: 分页-页码 schema: - type: string + type: integer + format: int32 + default: 0 + - name: pageSize + in: query + required: false + description: 分页-每页记录数 + schema: + type: integer + format: int32 + default: 1000 + requestBody: + description: 应用内角色ID列表 + required: true + content: + application/json: + schema: + type: array + items: + title: 应用内角色ID + type: string responses: '200': - description: 角色关联的用户组列表 + description: 角色关联的帐号ID content: application/json: schema: - $ref: '#/components/schemas/ApplicationRoleGroupsResponse' + $ref: '#/components/schemas/ApplicationExternalRolesAccountsResponse' default: $ref: '#/components/responses/DefaultErrorResponse' @@ -512,7 +568,7 @@ components: $ref: '#/components/schemas/Role' - ApplicationRolesAccountsResponse: + ApplicationRoleGroupsResponse: allOf: - $ref: '#/components/schemas/DefaultApiResponse' - type: object @@ -526,12 +582,39 @@ components: applicationId: title: 应用标识 type: string - roleIds: - title: 角色IDs + rolecode: + title: 角色代码 + type: string + groupIds: + title: 用户组ID列表 type: array items: - title: 角色ID + title: 用户组ID type: string + groups: + title: 用户组列表 + type: array + items: + $ref: '#/components/schemas/GroupModel' + + + ApplicationExternalRoleAccountsResponse: + allOf: + - $ref: '#/components/schemas/DefaultApiResponse' + - type: object + title: 响应数据 + properties: + data: + allOf: + - type: object + title: 数据 + properties: + applicationId: + title: 应用标识 + type: string + externalId: + title: 应用内角色ID + type: string accounts: title: 用户帐号数据 type: array @@ -539,8 +622,7 @@ components: title: 用户的帐号ID type: string - - ApplicationRoleGroupsResponse: + ApplicationExternalRolesAccountsResponse: allOf: - $ref: '#/components/schemas/DefaultApiResponse' - type: object @@ -554,18 +636,15 @@ components: applicationId: title: 应用标识 type: string - rolecode: - title: 角色代码 - type: string - groupIds: - title: 用户组ID列表 + externalIds: + title: 应用内角色IDs type: array items: - title: 用户组ID + title: 角色ID type: string - groups: - title: 用户组列表 + accounts: + title: 用户帐号数据 type: array items: - $ref: '#/components/schemas/GroupModel' - + title: 用户的帐号ID + type: string