1158 lines
30 KiB
YAML
1158 lines
30 KiB
YAML
openapi: 3.0.3
|
|
info:
|
|
title: Wireguard-UI HTTP API
|
|
version: 1.0.0
|
|
description: |
|
|
Wireguard-UI 后端 HTTP 接口 OpenAPI 文档。
|
|
|
|
所有业务接口统一前缀为 `/api`。除 `/api/login/captcha` 与 `/api/login` 外,其余接口都需要同时携带:
|
|
- `Authorization: Bearer <token>`
|
|
- `X-TOKEN: <secret>`
|
|
|
|
已鉴权接口在成功响应时,服务端还会刷新并返回新的 `Authorization` 与 `X-TOKEN` 响应头。
|
|
servers:
|
|
- url: http://localhost:6687
|
|
description: Local default
|
|
tags:
|
|
- name: Login
|
|
- name: User
|
|
- name: Client
|
|
- name: Setting
|
|
- name: Dashboard
|
|
paths:
|
|
/api/login/captcha:
|
|
get:
|
|
tags: [Login]
|
|
summary: 获取登录验证码
|
|
operationId: getLoginCaptcha
|
|
responses:
|
|
'200':
|
|
description: 成功
|
|
content:
|
|
application/json:
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
- type: object
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/CaptchaData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'500':
|
|
$ref: '#/components/responses/InternalError'
|
|
/api/login:
|
|
post:
|
|
tags: [Login]
|
|
summary: 登录
|
|
operationId: login
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/LoginRequest'
|
|
application/x-www-form-urlencoded:
|
|
schema:
|
|
$ref: '#/components/schemas/LoginRequest'
|
|
responses:
|
|
'200':
|
|
description: 登录成功
|
|
headers:
|
|
X-TOKEN:
|
|
description: 后续请求必须携带的密钥头
|
|
schema:
|
|
type: string
|
|
content:
|
|
application/json:
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
- type: object
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/LoginData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
/api/user/info:
|
|
get:
|
|
tags: [User]
|
|
summary: 获取当前登录用户
|
|
operationId: getCurrentUser
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
responses:
|
|
'200':
|
|
$ref: '#/components/responses/UserResponse'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/user:
|
|
post:
|
|
tags: [User]
|
|
summary: 新增或编辑用户
|
|
operationId: saveUser
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SaveUserRequest'
|
|
application/x-www-form-urlencoded:
|
|
schema:
|
|
$ref: '#/components/schemas/SaveUserRequest'
|
|
responses:
|
|
'200':
|
|
$ref: '#/components/responses/SuccessNoData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/user/list:
|
|
get:
|
|
tags: [User]
|
|
summary: 用户分页列表
|
|
operationId: listUsers
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
parameters:
|
|
- $ref: '#/components/parameters/Current'
|
|
- $ref: '#/components/parameters/Size'
|
|
responses:
|
|
'200':
|
|
description: 成功
|
|
content:
|
|
application/json:
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
- type: object
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/UserPageData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/user/{id}:
|
|
delete:
|
|
tags: [User]
|
|
summary: 删除用户
|
|
operationId: deleteUser
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
parameters:
|
|
- $ref: '#/components/parameters/UserId'
|
|
responses:
|
|
'200':
|
|
$ref: '#/components/responses/SuccessNoData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/user/status/{id}:
|
|
put:
|
|
tags: [User]
|
|
summary: 切换用户状态
|
|
operationId: toggleUserStatus
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
parameters:
|
|
- $ref: '#/components/parameters/UserId'
|
|
responses:
|
|
'200':
|
|
$ref: '#/components/responses/SuccessNoData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/user/change-password:
|
|
put:
|
|
tags: [User]
|
|
summary: 修改当前用户密码
|
|
operationId: changePassword
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ChangePasswordRequest'
|
|
application/x-www-form-urlencoded:
|
|
schema:
|
|
$ref: '#/components/schemas/ChangePasswordRequest'
|
|
responses:
|
|
'200':
|
|
$ref: '#/components/responses/SuccessNoData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/user/reset-password/{id}:
|
|
put:
|
|
tags: [User]
|
|
summary: 重置指定用户密码
|
|
description: "重置后的密码固定为 `admin123`。"
|
|
operationId: resetUserPassword
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
parameters:
|
|
- $ref: '#/components/parameters/UserId'
|
|
responses:
|
|
'200':
|
|
$ref: '#/components/responses/SuccessNoData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/user/generate-avatar:
|
|
post:
|
|
tags: [User]
|
|
summary: 生成随机头像
|
|
operationId: generateAvatar
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
responses:
|
|
'200':
|
|
description: 成功
|
|
content:
|
|
application/json:
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
- type: object
|
|
properties:
|
|
data:
|
|
type: string
|
|
description: "`data:image/png;base64,...`"
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/user/logout:
|
|
post:
|
|
tags: [User]
|
|
summary: 退出登录
|
|
operationId: logout
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
responses:
|
|
'200':
|
|
$ref: '#/components/responses/SuccessNoData'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/client:
|
|
post:
|
|
tags: [Client]
|
|
summary: 新增或编辑客户端
|
|
operationId: saveClient
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SaveClientRequest'
|
|
application/x-www-form-urlencoded:
|
|
schema:
|
|
$ref: '#/components/schemas/SaveClientRequest'
|
|
responses:
|
|
'200':
|
|
$ref: '#/components/responses/SuccessNoData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/client/{id}:
|
|
delete:
|
|
tags: [Client]
|
|
summary: 删除客户端
|
|
operationId: deleteClient
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
parameters:
|
|
- $ref: '#/components/parameters/ClientId'
|
|
responses:
|
|
'200':
|
|
$ref: '#/components/responses/SuccessNoData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/client/list:
|
|
get:
|
|
tags: [Client]
|
|
summary: 客户端分页列表
|
|
operationId: listClients
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
parameters:
|
|
- name: name
|
|
in: query
|
|
schema:
|
|
type: string
|
|
- name: email
|
|
in: query
|
|
schema:
|
|
type: string
|
|
format: email
|
|
- name: ipAllocation
|
|
in: query
|
|
schema:
|
|
type: string
|
|
- name: enabled
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
enum: [0, 1]
|
|
- $ref: '#/components/parameters/Current'
|
|
- $ref: '#/components/parameters/Size'
|
|
responses:
|
|
'200':
|
|
description: 成功
|
|
content:
|
|
application/json:
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
- type: object
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/ClientPageData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/client/generate-keys:
|
|
post:
|
|
tags: [Client]
|
|
summary: 生成客户端密钥
|
|
operationId: generateClientKeys
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
responses:
|
|
'200':
|
|
description: 成功
|
|
content:
|
|
application/json:
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
- type: object
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/Keys'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/client/generate-ip:
|
|
post:
|
|
tags: [Client]
|
|
summary: 生成客户端 IP
|
|
operationId: generateClientIp
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
responses:
|
|
'200':
|
|
description: 成功
|
|
content:
|
|
application/json:
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
- type: object
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/GenerateIpData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/client/download/{id}/{type}:
|
|
get:
|
|
tags: [Client]
|
|
summary: 下载客户端配置
|
|
description: |
|
|
`type` 支持三种模式:
|
|
- `QRCODE`: 返回二维码 base64
|
|
- `FILE`: 返回二进制配置文件
|
|
- `EMAIL`: 发送到客户端配置的邮箱,接口本身返回成功 JSON
|
|
operationId: downloadClientConfig
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
parameters:
|
|
- $ref: '#/components/parameters/ClientId'
|
|
- name: type
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
enum: [QRCODE, FILE, EMAIL]
|
|
responses:
|
|
'200':
|
|
description: 成功
|
|
content:
|
|
application/json:
|
|
schema:
|
|
oneOf:
|
|
- allOf:
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
- type: object
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/QrCodeData'
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
application/octet-stream:
|
|
schema:
|
|
type: string
|
|
format: binary
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/setting:
|
|
get:
|
|
tags: [Setting]
|
|
summary: 获取指定配置
|
|
operationId: getSetting
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
parameters:
|
|
- name: code
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'200':
|
|
description: 成功
|
|
content:
|
|
application/json:
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
- type: object
|
|
properties:
|
|
data:
|
|
type: string
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
post:
|
|
tags: [Setting]
|
|
summary: 新增或编辑配置
|
|
operationId: saveSetting
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SetSettingRequest'
|
|
application/x-www-form-urlencoded:
|
|
schema:
|
|
$ref: '#/components/schemas/SetSettingRequest'
|
|
responses:
|
|
'200':
|
|
$ref: '#/components/responses/SuccessNoData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/setting/{code}:
|
|
delete:
|
|
tags: [Setting]
|
|
summary: 删除配置
|
|
operationId: deleteSetting
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
parameters:
|
|
- name: code
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'200':
|
|
$ref: '#/components/responses/SuccessNoData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/setting/all:
|
|
get:
|
|
tags: [Setting]
|
|
summary: 获取全部配置
|
|
operationId: getAllSettings
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
responses:
|
|
'200':
|
|
description: 成功
|
|
content:
|
|
application/json:
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
- type: object
|
|
properties:
|
|
data:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/SettingItem'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/setting/public-addr:
|
|
get:
|
|
tags: [Setting]
|
|
summary: 获取公网地址
|
|
operationId: getPublicAddress
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
responses:
|
|
'200':
|
|
description: 成功
|
|
content:
|
|
application/json:
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
- type: object
|
|
properties:
|
|
data:
|
|
type: string
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/setting/export:
|
|
get:
|
|
tags: [Setting]
|
|
summary: 导出配置
|
|
description: "仅 `admin` 账号可执行。"
|
|
operationId: exportSettings
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
responses:
|
|
'200':
|
|
description: 导出成功
|
|
content:
|
|
application/octet-stream:
|
|
schema:
|
|
type: string
|
|
format: binary
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/setting/import:
|
|
post:
|
|
tags: [Setting]
|
|
summary: 导入配置
|
|
description: "仅 `admin` 账号可执行,且上传文件名必须为 `config.json`。"
|
|
operationId: importSettings
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
multipart/form-data:
|
|
schema:
|
|
type: object
|
|
required: [file]
|
|
properties:
|
|
file:
|
|
type: string
|
|
format: binary
|
|
responses:
|
|
'200':
|
|
$ref: '#/components/responses/SuccessNoData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/dashboard/request/list:
|
|
get:
|
|
tags: [Dashboard]
|
|
summary: 请求日志分页列表
|
|
operationId: listRequestLogs
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
parameters:
|
|
- $ref: '#/components/parameters/Current'
|
|
- $ref: '#/components/parameters/Size'
|
|
responses:
|
|
'200':
|
|
description: 成功
|
|
content:
|
|
application/json:
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
- type: object
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/SystemLogPageData'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/dashboard/daily-poetry:
|
|
get:
|
|
tags: [Dashboard]
|
|
summary: 获取每日诗词
|
|
operationId: getDailyPoetry
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
responses:
|
|
'200':
|
|
description: 成功
|
|
content:
|
|
application/json:
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
- type: object
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/Poetry'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
/api/dashboard/connections:
|
|
get:
|
|
tags: [Dashboard]
|
|
summary: 客户端连接信息列表
|
|
operationId: listConnections
|
|
security:
|
|
- bearerAuth: []
|
|
xTokenAuth: []
|
|
responses:
|
|
'200':
|
|
description: 成功
|
|
content:
|
|
application/json:
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
- type: object
|
|
properties:
|
|
data:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/DataTraffic'
|
|
'400':
|
|
$ref: '#/components/responses/BadRequest'
|
|
'401':
|
|
$ref: '#/components/responses/Unauthorized'
|
|
components:
|
|
securitySchemes:
|
|
bearerAuth:
|
|
type: http
|
|
scheme: bearer
|
|
bearerFormat: JWT
|
|
description: "格式为 `Bearer <token>`。"
|
|
xTokenAuth:
|
|
type: apiKey
|
|
in: header
|
|
name: X-TOKEN
|
|
description: 登录成功或鉴权成功后服务端返回的密钥头。
|
|
parameters:
|
|
Current:
|
|
name: current
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
minimum: 1
|
|
Size:
|
|
name: size
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
minimum: 1
|
|
UserId:
|
|
name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
ClientId:
|
|
name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
SuccessNoData:
|
|
description: 成功
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SuccessResponse'
|
|
BadRequest:
|
|
description: 请求错误
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ErrorResponse'
|
|
Unauthorized:
|
|
description: 未登录或鉴权失败
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
InternalError:
|
|
description: 服务端错误
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: integer
|
|
example: 500
|
|
message:
|
|
type: string
|
|
example: server error
|
|
required: [code, message]
|
|
UserResponse:
|
|
description: 成功
|
|
content:
|
|
application/json:
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/components/schemas/SuccessResponse'
|
|
- type: object
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/User'
|
|
schemas:
|
|
SuccessResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: integer
|
|
example: 200
|
|
message:
|
|
type: string
|
|
example: success
|
|
required: [code, message]
|
|
ErrorResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: integer
|
|
example: 400
|
|
message:
|
|
type: string
|
|
example: failed
|
|
required: [code, message]
|
|
UnauthorizedResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: integer
|
|
example: 401
|
|
message:
|
|
type: string
|
|
example: 未登陆
|
|
required: [code, message]
|
|
CaptchaData:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
captcha:
|
|
type: string
|
|
description: base64 图片内容
|
|
required: [id, captcha]
|
|
LoginRequest:
|
|
type: object
|
|
required: [account, password, captchaId, captchaCode]
|
|
properties:
|
|
account:
|
|
type: string
|
|
minLength: 2
|
|
maxLength: 20
|
|
password:
|
|
type: string
|
|
minLength: 8
|
|
maxLength: 32
|
|
captchaId:
|
|
type: string
|
|
captchaCode:
|
|
type: string
|
|
maxLength: 4
|
|
LoginData:
|
|
type: object
|
|
properties:
|
|
token:
|
|
type: string
|
|
type:
|
|
type: string
|
|
example: Bearer
|
|
expireAt:
|
|
type: string
|
|
required: [token, type, expireAt]
|
|
SaveUserRequest:
|
|
type: object
|
|
required: [nickname, isAdmin, status]
|
|
properties:
|
|
id:
|
|
type: string
|
|
account:
|
|
type: string
|
|
description: 新增时必填
|
|
password:
|
|
type: string
|
|
nickname:
|
|
type: string
|
|
minLength: 2
|
|
avatar:
|
|
type: string
|
|
description: "URL 或 `data:image/png;base64,...`"
|
|
contact:
|
|
type: string
|
|
isAdmin:
|
|
type: integer
|
|
enum: [0, 1]
|
|
status:
|
|
type: integer
|
|
enum: [0, 1]
|
|
ChangePasswordRequest:
|
|
type: object
|
|
required: [originalPassword, newPassword, confirmPassword]
|
|
properties:
|
|
originalPassword:
|
|
type: string
|
|
minLength: 8
|
|
maxLength: 32
|
|
newPassword:
|
|
type: string
|
|
minLength: 8
|
|
maxLength: 32
|
|
confirmPassword:
|
|
type: string
|
|
description: "必须与 `newPassword` 相同"
|
|
SaveClientRequest:
|
|
type: object
|
|
required:
|
|
- name
|
|
- ipAllocation
|
|
- useServerDns
|
|
- keys
|
|
- enabled
|
|
- offlineMonitoring
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
minLength: 1
|
|
maxLength: 64
|
|
email:
|
|
type: string
|
|
subnetRange:
|
|
type: string
|
|
ipAllocation:
|
|
type: array
|
|
items:
|
|
type: string
|
|
allowedIps:
|
|
type: array
|
|
items:
|
|
type: string
|
|
extraAllowedIps:
|
|
type: array
|
|
items:
|
|
type: string
|
|
endpoint:
|
|
type: string
|
|
useServerDns:
|
|
type: integer
|
|
enum: [0, 1]
|
|
keys:
|
|
$ref: '#/components/schemas/Keys'
|
|
enabled:
|
|
type: integer
|
|
enum: [0, 1]
|
|
offlineMonitoring:
|
|
type: integer
|
|
enum: [0, 1]
|
|
SetSettingRequest:
|
|
type: object
|
|
required: [code, data]
|
|
properties:
|
|
code:
|
|
type: string
|
|
data:
|
|
type: string
|
|
describe:
|
|
type: string
|
|
Keys:
|
|
type: object
|
|
properties:
|
|
privateKey:
|
|
type: string
|
|
publicKey:
|
|
type: string
|
|
presharedKey:
|
|
type: string
|
|
required: [privateKey, publicKey, presharedKey]
|
|
GenerateIpData:
|
|
type: object
|
|
properties:
|
|
clientIPS:
|
|
type: array
|
|
items:
|
|
type: string
|
|
serverIPS:
|
|
type: string
|
|
required: [clientIPS, serverIPS]
|
|
QrCodeData:
|
|
type: object
|
|
properties:
|
|
qrCode:
|
|
type: string
|
|
required: [qrCode]
|
|
User:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
account:
|
|
type: string
|
|
nickname:
|
|
type: string
|
|
avatar:
|
|
type: string
|
|
contact:
|
|
type: string
|
|
isAdmin:
|
|
type: integer
|
|
enum: [0, 1]
|
|
status:
|
|
type: integer
|
|
enum: [0, 1]
|
|
required: [id, account, nickname, avatar, contact, isAdmin, status]
|
|
UserItem:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
account:
|
|
type: string
|
|
nickname:
|
|
type: string
|
|
avatar:
|
|
type: string
|
|
contact:
|
|
type: string
|
|
isAdmin:
|
|
type: integer
|
|
enum: [0, 1]
|
|
status:
|
|
type: integer
|
|
enum: [0, 1]
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
updatedAt:
|
|
type: string
|
|
format: date-time
|
|
UserPageData:
|
|
type: object
|
|
properties:
|
|
current:
|
|
type: integer
|
|
size:
|
|
type: integer
|
|
total:
|
|
type: integer
|
|
format: int64
|
|
totalPage:
|
|
type: integer
|
|
records:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/UserItem'
|
|
required: [current, size, total, totalPage, records]
|
|
ClientItem:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
email:
|
|
type: string
|
|
ipAllocation:
|
|
type: array
|
|
items:
|
|
type: string
|
|
allowedIps:
|
|
type: array
|
|
items:
|
|
type: string
|
|
extraAllowedIps:
|
|
type: array
|
|
items:
|
|
type: string
|
|
endpoint:
|
|
type: string
|
|
useServerDns:
|
|
type: integer
|
|
enum: [0, 1]
|
|
keys:
|
|
$ref: '#/components/schemas/Keys'
|
|
createUser:
|
|
type: string
|
|
enabled:
|
|
type: integer
|
|
enum: [0, 1]
|
|
offlineMonitoring:
|
|
type: integer
|
|
enum: [0, 1]
|
|
dataTraffic:
|
|
$ref: '#/components/schemas/DataTraffic'
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
updatedAt:
|
|
type: string
|
|
format: date-time
|
|
ClientPageData:
|
|
type: object
|
|
properties:
|
|
current:
|
|
type: integer
|
|
size:
|
|
type: integer
|
|
total:
|
|
type: integer
|
|
format: int64
|
|
totalPage:
|
|
type: integer
|
|
records:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/ClientItem'
|
|
required: [current, size, total, totalPage, records]
|
|
SettingItem:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: string
|
|
data:
|
|
type: string
|
|
describe:
|
|
type: string
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
updatedAt:
|
|
type: string
|
|
format: date-time
|
|
required: [code, data, describe, createdAt, updatedAt]
|
|
SystemLogItem:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
username:
|
|
type: string
|
|
clientIP:
|
|
type: string
|
|
method:
|
|
type: string
|
|
host:
|
|
type: string
|
|
uri:
|
|
type: string
|
|
statusCode:
|
|
type: integer
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
required: [id, username, clientIP, method, host, uri, statusCode, createdAt]
|
|
SystemLogPageData:
|
|
type: object
|
|
properties:
|
|
current:
|
|
type: integer
|
|
size:
|
|
type: integer
|
|
total:
|
|
type: integer
|
|
format: int64
|
|
totalPage:
|
|
type: integer
|
|
records:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/SystemLogItem'
|
|
required: [current, size, total, totalPage, records]
|
|
Poetry:
|
|
type: object
|
|
properties:
|
|
content:
|
|
type: string
|
|
author:
|
|
type: string
|
|
required: [content, author]
|
|
DataTraffic:
|
|
type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
email:
|
|
type: string
|
|
ipAllocation:
|
|
type: string
|
|
online:
|
|
type: boolean
|
|
receiveBytes:
|
|
type: string
|
|
transmitBytes:
|
|
type: string
|
|
connectEndpoint:
|
|
type: string
|
|
lastHandAt:
|
|
type: string
|
|
required:
|
|
- name
|
|
- email
|
|
- ipAllocation
|
|
- online
|
|
- receiveBytes
|
|
- transmitBytes
|
|
- connectEndpoint
|
|
- lastHandAt
|