Files
Web_BAI_Manage_ApiServer/pocket-base/spec/openapi-wx/system.yaml

254 lines
8.4 KiB
YAML
Raw Normal View History

paths:
usersCount:
post:
security: []
operationId: postSystemUsersCount
tags:
- 系统
summary: 查询用户总数
description: 统计 `tbl_auth_users` 集合中的记录总数。
responses:
"200":
description: 查询成功
content:
application/json:
schema:
$ref: ../openapi-wx.yaml#/components/schemas/UsersCountResponse
example:
statusCode: 业务状态码|integer
errMsg: 业务提示信息|string
data:
total_users: total_users|integer
"400":
description: 请求参数错误
content:
application/json:
schema:
$ref: ../openapi-wx.yaml#/components/schemas/ErrorResponse
example:
statusCode: 业务状态码|integer
errMsg: 业务提示信息|string
data:
业务响应数据字段|string: 业务响应数据值|string
"500":
description: 服务端错误
content:
application/json:
schema:
$ref: ../openapi-wx.yaml#/components/schemas/ErrorResponse
example:
statusCode: 业务状态码|integer
errMsg: 业务提示信息|string
data:
业务响应数据字段|string: 业务响应数据值|string
refreshToken:
post:
security:
- BearerAuth: []
- {}
operationId: postSystemRefreshToken
tags:
- 系统
summary: 刷新认证 token
description: |
当当前 `Authorization` 仍有效时,直接基于当前 auth 用户续签。
当 token 失效时,可传入 `users_wx_code` 走微信 code 重新签发。
requestBody:
required: false
content:
application/json:
schema:
$ref: ../openapi-wx.yaml#/components/schemas/SystemRefreshTokenRequest
example:
users_wx_code: 当前 token 失效时,可通过该 code 重新签发 token。|string
responses:
"200":
description: 刷新成功
content:
application/json:
schema:
$ref: ../openapi-wx.yaml#/components/schemas/RefreshTokenResponse
example:
statusCode: 业务状态码|integer
errMsg: 业务提示信息|string
data:
业务响应数据字段|string: 业务响应数据值|string
token: 新签发的 PocketBase 原生 auth token|string
"400":
description: 参数错误或微信 code 换取失败
content:
application/json:
schema:
$ref: ../openapi-wx.yaml#/components/schemas/ErrorResponse
example:
statusCode: 业务状态码|integer
errMsg: 业务提示信息|string
data:
业务响应数据字段|string: 业务响应数据值|string
"401":
description: token 无效,且未提供有效的 `users_wx_code`
content:
application/json:
schema:
$ref: ../openapi-wx.yaml#/components/schemas/ErrorResponse
example:
statusCode: 业务状态码|integer
errMsg: 业务提示信息|string
data:
业务响应数据字段|string: 业务响应数据值|string
"404":
description: 当前用户不存在
content:
application/json:
schema:
$ref: ../openapi-wx.yaml#/components/schemas/ErrorResponse
example:
statusCode: 业务状态码|integer
errMsg: 业务提示信息|string
data:
业务响应数据字段|string: 业务响应数据值|string
"415":
description: 请求体不是 JSON
content:
application/json:
schema:
$ref: ../openapi-wx.yaml#/components/schemas/ErrorResponse
example:
statusCode: 业务状态码|integer
errMsg: 业务提示信息|string
data:
业务响应数据字段|string: 业务响应数据值|string
"429":
description: 请求过于频繁
content:
application/json:
schema:
$ref: ../openapi-wx.yaml#/components/schemas/ErrorResponse
example:
statusCode: 业务状态码|integer
errMsg: 业务提示信息|string
data:
业务响应数据字段|string: 业务响应数据值|string
"500":
description: 服务端错误
content:
application/json:
schema:
$ref: ../openapi-wx.yaml#/components/schemas/ErrorResponse
example:
statusCode: 业务状态码|integer
errMsg: 业务提示信息|string
data:
业务响应数据字段|string: 业务响应数据值|string
components:
schemas:
ApiResponseBase:
type: object
required:
- statusCode
- errMsg
- data
properties:
statusCode:
type:
- integer
- string
description: 业务状态码
example: 业务状态码 | integer
errMsg:
type: string
description: 业务提示信息
example: 业务提示信息 | string
data:
description: 业务响应数据
type: object
additionalProperties: true
example:
statusCode: 业务状态码|integer
errMsg: 业务提示信息|string
data:
业务响应数据字段|string: 业务响应数据值|string
ErrorResponse:
type: object
required:
- statusCode
- errMsg
- data
properties:
statusCode:
type:
- integer
- string
description: 业务状态码
example: 业务状态码 | integer
errMsg:
type: string
description: 业务提示信息
example: 失败原因提示 | string
data:
description: 业务响应数据
type: object
additionalProperties: true
example:
statusCode: 业务状态码|integer
errMsg: 业务提示信息|string
data:
业务响应数据字段|string: 业务响应数据值|string
SystemRefreshTokenRequest:
type: object
properties:
users_wx_code:
type:
- string
- "null"
description: |
可选。
当前 token 失效时,可通过该 code 重新签发 token。
example: 0a1b2c3d4e5f6g
example:
users_wx_code: 当前 token 失效时,可通过该 code 重新签发 token。|string
RefreshTokenResponse:
allOf:
- $ref: ../openapi-wx.yaml#/components/schemas/ApiResponseBase
- type: object
required:
- token
properties:
data:
type: object
additionalProperties: true
description: 业务响应数据
example: {}
token:
type: string
description: 新签发的 PocketBase 原生 auth token
example:
statusCode: 业务状态码|integer
errMsg: 业务提示信息|string
data:
业务响应数据字段|string: 业务响应数据值|string
token: 新签发的 PocketBase 原生 auth token|string
UsersCountData:
type: object
properties:
total_users:
type:
- integer
- string
example: 用户总数 | integer
example:
total_users: total_users|integer
UsersCountResponse:
allOf:
- $ref: ../openapi-wx.yaml#/components/schemas/ApiResponseBase
- type: object
properties:
data:
description: 业务响应数据
$ref: ../openapi-wx.yaml#/components/schemas/UsersCountData
example:
statusCode: 业务状态码|integer
errMsg: 业务提示信息|string
data:
total_users: total_users|integer