# 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:
format: int32
default: 1000
requestBody:
- description: 角色IDs
+ description: 角色ID
required: true
content:
application/json:
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
- type: object
title: 实体属性
properties:
+ applicationId:
+ title: 所属应用
+ type: string
code:
title: 代码
type: string
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
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'
+