blob: 6627c511884796f68d9b7b106a8110c3e0bf300e [file] [log] [blame]
# admin-center-poa.v1.yaml
#
# 1. 创建服务
# curl -i -s -X POST 'https://poa-sa.dev.supwisdom.com/v1/services' -H 'Content-Type: application/json' -d '{"id": "admincenter", "origin": "http://admin-center-poa-svc.admin-center.svc.cluster.local:8080", "name": "管理中心", "description": "管理中心"}'
#
# 2. 创建版本
# curl -i -s -X POST 'https://poa-sa.dev.supwisdom.com/v1/services/admincenter/apiVersions/v1'
#
# 3. 上传OAS Yaml
# curl -i -s -X POST 'https://poa-sa.dev.supwisdom.com/v1/services/admincenter/apiVersions/v1/apiSpecs' -H 'Content-Type: application/yaml' --data-binary @admin-center-poa.v1.yaml
#
# 4. 发布版本
# curl -i -s -X POST 'https://poa-sa.dev.supwisdom.com/v1/services/admincenter/apiVersions/v1/publish'
#
openapi: 3.0.2
info:
title: Admin Center Platform Open APIs
version: v1
description: '管理中心 - 平台开放接口'
servers:
- url: '${POA_SERVER_URL}/apis/admincenter/v1'
description: '正式环境'
tags:
- name: Menu
description: '管理中心菜单'
paths:
'/menus/accountName/{accountName}/menus':
get:
summary: 获取用户帐号可访问的菜单
description: 获取用户帐号可访问的菜单
operationId: loadAccountMenus
tags:
- Menu
security:
- oauth2:
- "admincenter:v1:readMenu"
parameters:
- name: accountName
in: path
required: true
description: 用户名
schema:
type: string
# - name: applicationId
# in: query
# required: true
# description: 应用标识
# schema:
# type: string
responses:
'200':
description: 菜单列表
content:
application/json:
schema:
$ref: '#/components/schemas/GrantedMenusResponse'
default:
$ref: '#/components/responses/DefaultErrorResponse'
components:
# Security Schemes
securitySchemes:
oauth2:
type: oauth2
flows:
clientCredentials:
tokenUrl: ${POA_SERVER_URL}/oauth2/token
scopes:
"admincenter:v1:readMenu": "读取后台菜单"
responses:
'ErrorResponse400':
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
DefaultErrorResponse:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
schemas:
# Error
ErrorResponse:
title: '异常响应'
required:
- code
- message
properties:
code:
title: 异常代码
type: integer
format: int32
default: -1
message:
title: 异常信息
type: string
default: "未知错误"
# DTO
GrantedMenu:
title: DTO - 菜单数据
type: object
properties:
id:
title: ID
type: string
code:
title: 代码
type: string
name:
title: 名称
type: string
memo:
title: 备注
type: string
status:
title: 状态(1 启用,0 停用)
type: string
icon:
title: 菜单图标
type: string
origin:
title: 来源系统
type: string
url:
title: URL地址
type: string
applicationId:
title: 系统ID
type: string
parentId:
title: 父级ID
type: string
order:
title: 排序
type: string
# Request VO
# Response Data
GrantedMenusResponseData:
title: 响应数据 - 菜单列表
type: object
properties:
menus:
title: 菜单列表
type: array
items:
$ref: '#/components/schemas/GrantedMenu'
# Response VO
ApiDataResponse:
title: 响应
properties:
code:
title: 响应代码
type: integer
format: int32
default: 0
message:
title: 响应信息
type: string
data:
title: 响应数据
type: object
DefaultApiDataResponse:
allOf:
- $ref: '#/components/schemas/ApiDataResponse'
- type: object
title: 响应
properties:
data:
title: 响应数据
type: object
GrantedMenusResponse:
allOf:
- $ref: '#/components/schemas/DefaultApiDataResponse'
- type: object
title: 响应
properties:
data:
allOf:
- $ref: '#/components/schemas/GrantedMenusResponseData'