主要变更: - 新增B端认证系统(后台+H5):登录、登出、Token刷新、密码修改 - 完善商户管理和商户账号管理功能 - 补全单元测试(ShopService: 72.5%, ShopAccountService: 79.8%) - 新增集成测试(商户管理+商户账号管理) - 归档OpenSpec提案(add-shop-account-management, implement-b-end-auth-system) - 完善文档(使用指南、API文档、认证架构说明) 测试统计: - 13个测试套件,37个测试用例,100%通过率 - 平均覆盖率76.2%,达标 OpenSpec验证:通过(strict模式)
2422 lines
86 KiB
YAML
2422 lines
86 KiB
YAML
components:
|
||
schemas:
|
||
ErrorResponse:
|
||
properties:
|
||
code:
|
||
description: 错误码
|
||
type: integer
|
||
message:
|
||
description: 错误消息
|
||
type: string
|
||
timestamp:
|
||
description: 时间戳
|
||
format: date-time
|
||
type: string
|
||
required:
|
||
- code
|
||
- message
|
||
- timestamp
|
||
type: object
|
||
ModelAccountPageResult:
|
||
properties:
|
||
items:
|
||
description: 账号列表
|
||
items:
|
||
$ref: '#/components/schemas/ModelAccountResponse'
|
||
nullable: true
|
||
type: array
|
||
page:
|
||
description: 当前页码
|
||
type: integer
|
||
size:
|
||
description: 每页数量
|
||
type: integer
|
||
total:
|
||
description: 总记录数
|
||
type: integer
|
||
type: object
|
||
ModelAccountResponse:
|
||
properties:
|
||
created_at:
|
||
description: 创建时间
|
||
type: string
|
||
creator:
|
||
description: 创建人ID
|
||
minimum: 0
|
||
type: integer
|
||
enterprise_id:
|
||
description: 关联企业ID
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
id:
|
||
description: 账号ID
|
||
minimum: 0
|
||
type: integer
|
||
phone:
|
||
description: 手机号
|
||
type: string
|
||
shop_id:
|
||
description: 关联店铺ID
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
status:
|
||
description: 状态
|
||
type: integer
|
||
updated_at:
|
||
description: 更新时间
|
||
type: string
|
||
updater:
|
||
description: 更新人ID
|
||
minimum: 0
|
||
type: integer
|
||
user_type:
|
||
description: 用户类型
|
||
type: integer
|
||
username:
|
||
description: 用户名
|
||
type: string
|
||
type: object
|
||
ModelAssignPermissionsParams:
|
||
properties:
|
||
perm_ids:
|
||
description: 权限ID列表
|
||
items:
|
||
minimum: 0
|
||
type: integer
|
||
minItems: 1
|
||
nullable: true
|
||
type: array
|
||
required:
|
||
- perm_ids
|
||
type: object
|
||
ModelAssignRolesParams:
|
||
properties:
|
||
role_ids:
|
||
description: 角色ID列表,传空数组可清空所有角色
|
||
items:
|
||
minimum: 0
|
||
type: integer
|
||
nullable: true
|
||
type: array
|
||
type: object
|
||
ModelChangePasswordRequest:
|
||
properties:
|
||
new_password:
|
||
type: string
|
||
old_password:
|
||
type: string
|
||
type: object
|
||
ModelCreateAccountRequest:
|
||
properties:
|
||
enterprise_id:
|
||
description: 关联企业ID(企业账号必填)
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
password:
|
||
description: 密码
|
||
maxLength: 32
|
||
minLength: 8
|
||
type: string
|
||
phone:
|
||
description: 手机号
|
||
maxLength: 11
|
||
minLength: 11
|
||
type: string
|
||
shop_id:
|
||
description: 关联店铺ID(代理账号必填)
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
user_type:
|
||
description: 用户类型 (1:SuperAdmin, 2:Platform, 3:Agent, 4:Enterprise)
|
||
maximum: 4
|
||
minimum: 1
|
||
type: integer
|
||
username:
|
||
description: 用户名
|
||
maxLength: 50
|
||
minLength: 3
|
||
type: string
|
||
required:
|
||
- username
|
||
- phone
|
||
- password
|
||
- user_type
|
||
type: object
|
||
ModelCreatePermissionRequest:
|
||
properties:
|
||
parent_id:
|
||
description: 父权限ID
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
perm_code:
|
||
description: 权限编码
|
||
maxLength: 100
|
||
minLength: 1
|
||
type: string
|
||
perm_name:
|
||
description: 权限名称
|
||
maxLength: 50
|
||
minLength: 1
|
||
type: string
|
||
perm_type:
|
||
description: 权限类型 (1:菜单, 2:按钮)
|
||
maximum: 2
|
||
minimum: 1
|
||
type: integer
|
||
platform:
|
||
description: 适用端口 (all:全部, web:Web后台, h5:H5端),默认为 all
|
||
type: string
|
||
sort:
|
||
description: 排序值
|
||
minimum: 0
|
||
type: integer
|
||
url:
|
||
description: 请求路径
|
||
maxLength: 255
|
||
type: string
|
||
required:
|
||
- perm_name
|
||
- perm_code
|
||
- perm_type
|
||
type: object
|
||
ModelCreateRoleRequest:
|
||
properties:
|
||
role_desc:
|
||
description: 角色描述
|
||
maxLength: 255
|
||
type: string
|
||
role_name:
|
||
description: 角色名称
|
||
maxLength: 50
|
||
minLength: 1
|
||
type: string
|
||
role_type:
|
||
description: 角色类型 (1:平台角色, 2:客户角色)
|
||
maximum: 2
|
||
minimum: 1
|
||
type: integer
|
||
required:
|
||
- role_name
|
||
- role_type
|
||
type: object
|
||
ModelLoginRequest:
|
||
properties:
|
||
device:
|
||
type: string
|
||
password:
|
||
type: string
|
||
username:
|
||
type: string
|
||
type: object
|
||
ModelLoginResponse:
|
||
properties:
|
||
access_token:
|
||
type: string
|
||
expires_in:
|
||
type: integer
|
||
permissions:
|
||
items:
|
||
type: string
|
||
nullable: true
|
||
type: array
|
||
refresh_token:
|
||
type: string
|
||
user:
|
||
$ref: '#/components/schemas/ModelUserInfo'
|
||
type: object
|
||
ModelPermission:
|
||
properties:
|
||
available_for_role_types:
|
||
type: string
|
||
creator:
|
||
minimum: 0
|
||
type: integer
|
||
parent_id:
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
perm_code:
|
||
type: string
|
||
perm_name:
|
||
type: string
|
||
perm_type:
|
||
type: integer
|
||
platform:
|
||
type: string
|
||
sort:
|
||
type: integer
|
||
status:
|
||
type: integer
|
||
updater:
|
||
minimum: 0
|
||
type: integer
|
||
url:
|
||
type: string
|
||
type: object
|
||
ModelPermissionPageResult:
|
||
properties:
|
||
items:
|
||
description: 权限列表
|
||
items:
|
||
$ref: '#/components/schemas/ModelPermissionResponse'
|
||
nullable: true
|
||
type: array
|
||
page:
|
||
description: 当前页码
|
||
type: integer
|
||
size:
|
||
description: 每页数量
|
||
type: integer
|
||
total:
|
||
description: 总记录数
|
||
type: integer
|
||
type: object
|
||
ModelPermissionResponse:
|
||
properties:
|
||
available_for_role_types:
|
||
description: 可用角色类型
|
||
type: string
|
||
created_at:
|
||
description: 创建时间
|
||
type: string
|
||
creator:
|
||
description: 创建人ID
|
||
minimum: 0
|
||
type: integer
|
||
id:
|
||
description: 权限ID
|
||
minimum: 0
|
||
type: integer
|
||
parent_id:
|
||
description: 父权限ID
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
perm_code:
|
||
description: 权限编码
|
||
type: string
|
||
perm_name:
|
||
description: 权限名称
|
||
type: string
|
||
perm_type:
|
||
description: 权限类型
|
||
type: integer
|
||
platform:
|
||
description: 适用端口
|
||
type: string
|
||
sort:
|
||
description: 排序值
|
||
type: integer
|
||
status:
|
||
description: 状态
|
||
type: integer
|
||
updated_at:
|
||
description: 更新时间
|
||
type: string
|
||
updater:
|
||
description: 更新人ID
|
||
minimum: 0
|
||
type: integer
|
||
url:
|
||
description: 请求路径
|
||
type: string
|
||
type: object
|
||
ModelPermissionTreeNode:
|
||
properties:
|
||
available_for_role_types:
|
||
description: 可用角色类型
|
||
type: string
|
||
children:
|
||
description: 子权限列表
|
||
items:
|
||
$ref: '#/components/schemas/ModelPermissionTreeNode'
|
||
type: array
|
||
id:
|
||
description: 权限ID
|
||
minimum: 0
|
||
type: integer
|
||
perm_code:
|
||
description: 权限编码
|
||
type: string
|
||
perm_name:
|
||
description: 权限名称
|
||
type: string
|
||
perm_type:
|
||
description: 权限类型
|
||
type: integer
|
||
platform:
|
||
description: 适用端口
|
||
type: string
|
||
sort:
|
||
description: 排序值
|
||
type: integer
|
||
url:
|
||
description: 请求路径
|
||
type: string
|
||
type: object
|
||
ModelRefreshTokenRequest:
|
||
properties:
|
||
refresh_token:
|
||
type: string
|
||
type: object
|
||
ModelRefreshTokenResponse:
|
||
properties:
|
||
access_token:
|
||
type: string
|
||
expires_in:
|
||
type: integer
|
||
type: object
|
||
ModelRole:
|
||
properties:
|
||
creator:
|
||
minimum: 0
|
||
type: integer
|
||
role_desc:
|
||
type: string
|
||
role_name:
|
||
type: string
|
||
role_type:
|
||
type: integer
|
||
status:
|
||
type: integer
|
||
updater:
|
||
minimum: 0
|
||
type: integer
|
||
type: object
|
||
ModelRolePageResult:
|
||
properties:
|
||
items:
|
||
description: 角色列表
|
||
items:
|
||
$ref: '#/components/schemas/ModelRoleResponse'
|
||
nullable: true
|
||
type: array
|
||
page:
|
||
description: 当前页码
|
||
type: integer
|
||
size:
|
||
description: 每页数量
|
||
type: integer
|
||
total:
|
||
description: 总记录数
|
||
type: integer
|
||
type: object
|
||
ModelRoleResponse:
|
||
properties:
|
||
created_at:
|
||
description: 创建时间
|
||
type: string
|
||
creator:
|
||
description: 创建人ID
|
||
minimum: 0
|
||
type: integer
|
||
id:
|
||
description: 角色ID
|
||
minimum: 0
|
||
type: integer
|
||
role_desc:
|
||
description: 角色描述
|
||
type: string
|
||
role_name:
|
||
description: 角色名称
|
||
type: string
|
||
role_type:
|
||
description: 角色类型
|
||
type: integer
|
||
status:
|
||
description: 状态
|
||
type: integer
|
||
updated_at:
|
||
description: 更新时间
|
||
type: string
|
||
updater:
|
||
description: 更新人ID
|
||
minimum: 0
|
||
type: integer
|
||
type: object
|
||
ModelUpdateAccountParams:
|
||
properties:
|
||
password:
|
||
description: 密码
|
||
maxLength: 32
|
||
minLength: 8
|
||
nullable: true
|
||
type: string
|
||
phone:
|
||
description: 手机号
|
||
maxLength: 11
|
||
minLength: 11
|
||
nullable: true
|
||
type: string
|
||
status:
|
||
description: 状态 (0:禁用, 1:启用)
|
||
maximum: 1
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
username:
|
||
description: 用户名
|
||
maxLength: 50
|
||
minLength: 3
|
||
nullable: true
|
||
type: string
|
||
type: object
|
||
ModelUpdatePasswordParams:
|
||
properties:
|
||
new_password:
|
||
description: 新密码(8-32位)
|
||
maxLength: 32
|
||
minLength: 8
|
||
type: string
|
||
required:
|
||
- new_password
|
||
type: object
|
||
ModelUpdatePermissionParams:
|
||
properties:
|
||
parent_id:
|
||
description: 父权限ID
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
perm_code:
|
||
description: 权限编码
|
||
maxLength: 100
|
||
minLength: 1
|
||
nullable: true
|
||
type: string
|
||
perm_name:
|
||
description: 权限名称
|
||
maxLength: 50
|
||
minLength: 1
|
||
nullable: true
|
||
type: string
|
||
platform:
|
||
description: 适用端口 (all:全部, web:Web后台, h5:H5端)
|
||
nullable: true
|
||
type: string
|
||
sort:
|
||
description: 排序值
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
status:
|
||
description: 状态 (0:禁用, 1:启用)
|
||
maximum: 1
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
url:
|
||
description: 请求路径
|
||
maxLength: 255
|
||
nullable: true
|
||
type: string
|
||
type: object
|
||
ModelUpdateRoleParams:
|
||
properties:
|
||
role_desc:
|
||
description: 角色描述
|
||
maxLength: 255
|
||
nullable: true
|
||
type: string
|
||
role_name:
|
||
description: 角色名称
|
||
maxLength: 50
|
||
minLength: 1
|
||
nullable: true
|
||
type: string
|
||
status:
|
||
description: 状态 (0:禁用, 1:启用)
|
||
maximum: 1
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
type: object
|
||
ModelUpdateRoleStatusParams:
|
||
properties:
|
||
status:
|
||
description: 状态 (0:禁用, 1:启用)
|
||
maximum: 1
|
||
minimum: 0
|
||
type: integer
|
||
required:
|
||
- status
|
||
type: object
|
||
ModelUpdateStatusParams:
|
||
properties:
|
||
status:
|
||
description: 状态(0:禁用,1:启用)
|
||
maximum: 1
|
||
minimum: 0
|
||
type: integer
|
||
required:
|
||
- status
|
||
type: object
|
||
ModelUserInfo:
|
||
properties:
|
||
enterprise_id:
|
||
minimum: 0
|
||
type: integer
|
||
enterprise_name:
|
||
type: string
|
||
id:
|
||
minimum: 0
|
||
type: integer
|
||
phone:
|
||
type: string
|
||
shop_id:
|
||
minimum: 0
|
||
type: integer
|
||
shop_name:
|
||
type: string
|
||
user_type:
|
||
type: integer
|
||
user_type_name:
|
||
type: string
|
||
username:
|
||
type: string
|
||
type: object
|
||
securitySchemes:
|
||
BearerAuth:
|
||
bearerFormat: JWT
|
||
scheme: bearer
|
||
type: http
|
||
info:
|
||
title: Admin API
|
||
version: "1.0"
|
||
openapi: 3.0.3
|
||
paths:
|
||
/api/admin/accounts:
|
||
get:
|
||
parameters:
|
||
- description: 页码
|
||
in: query
|
||
name: page
|
||
schema:
|
||
description: 页码
|
||
minimum: 1
|
||
type: integer
|
||
- description: 每页数量
|
||
in: query
|
||
name: page_size
|
||
schema:
|
||
description: 每页数量
|
||
maximum: 100
|
||
minimum: 1
|
||
type: integer
|
||
- description: 用户名模糊查询
|
||
in: query
|
||
name: username
|
||
schema:
|
||
description: 用户名模糊查询
|
||
maxLength: 50
|
||
type: string
|
||
- description: 手机号模糊查询
|
||
in: query
|
||
name: phone
|
||
schema:
|
||
description: 手机号模糊查询
|
||
maxLength: 20
|
||
type: string
|
||
- description: 用户类型
|
||
in: query
|
||
name: user_type
|
||
schema:
|
||
description: 用户类型
|
||
maximum: 4
|
||
minimum: 1
|
||
nullable: true
|
||
type: integer
|
||
- description: 状态
|
||
in: query
|
||
name: status
|
||
schema:
|
||
description: 状态
|
||
maximum: 1
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelAccountPageResult'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 账号列表
|
||
tags:
|
||
- 账号相关
|
||
post:
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelCreateAccountRequest'
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelAccountResponse'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 创建账号
|
||
tags:
|
||
- 账号相关
|
||
/api/admin/accounts/{account_id}/roles/{role_id}:
|
||
delete:
|
||
parameters:
|
||
- description: 账号ID
|
||
in: path
|
||
name: account_id
|
||
required: true
|
||
schema:
|
||
description: 账号ID
|
||
minimum: 0
|
||
type: integer
|
||
- description: 角色ID
|
||
in: path
|
||
name: role_id
|
||
required: true
|
||
schema:
|
||
description: 角色ID
|
||
minimum: 0
|
||
type: integer
|
||
responses:
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 移除角色
|
||
tags:
|
||
- 账号相关
|
||
/api/admin/accounts/{id}:
|
||
delete:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
responses:
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 删除账号
|
||
tags:
|
||
- 账号相关
|
||
get:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelAccountResponse'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 获取账号详情
|
||
tags:
|
||
- 账号相关
|
||
put:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelUpdateAccountParams'
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelAccountResponse'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 更新账号
|
||
tags:
|
||
- 账号相关
|
||
/api/admin/accounts/{id}/roles:
|
||
get:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
items:
|
||
$ref: '#/components/schemas/ModelRole'
|
||
type: array
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 获取账号角色
|
||
tags:
|
||
- 账号相关
|
||
post:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelAssignRolesParams'
|
||
responses:
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
summary: 分配角色
|
||
tags:
|
||
- 账号相关
|
||
/api/admin/login:
|
||
post:
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelLoginRequest'
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelLoginResponse'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
summary: 后台登录
|
||
tags:
|
||
- 认证
|
||
/api/admin/logout:
|
||
post:
|
||
responses:
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 登出
|
||
tags:
|
||
- 认证
|
||
/api/admin/me:
|
||
get:
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelUserInfo'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 获取当前用户信息
|
||
tags:
|
||
- 认证
|
||
/api/admin/password:
|
||
put:
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelChangePasswordRequest'
|
||
responses:
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 修改密码
|
||
tags:
|
||
- 认证
|
||
/api/admin/permissions:
|
||
get:
|
||
parameters:
|
||
- description: 页码
|
||
in: query
|
||
name: page
|
||
schema:
|
||
description: 页码
|
||
minimum: 1
|
||
type: integer
|
||
- description: 每页数量
|
||
in: query
|
||
name: page_size
|
||
schema:
|
||
description: 每页数量
|
||
maximum: 100
|
||
minimum: 1
|
||
type: integer
|
||
- description: 权限名称模糊查询
|
||
in: query
|
||
name: perm_name
|
||
schema:
|
||
description: 权限名称模糊查询
|
||
maxLength: 50
|
||
type: string
|
||
- description: 权限编码模糊查询
|
||
in: query
|
||
name: perm_code
|
||
schema:
|
||
description: 权限编码模糊查询
|
||
maxLength: 100
|
||
type: string
|
||
- description: 权限类型
|
||
in: query
|
||
name: perm_type
|
||
schema:
|
||
description: 权限类型
|
||
maximum: 2
|
||
minimum: 1
|
||
nullable: true
|
||
type: integer
|
||
- description: 适用端口
|
||
in: query
|
||
name: platform
|
||
schema:
|
||
description: 适用端口
|
||
type: string
|
||
- description: 可用角色类型 (1:平台角色, 2:客户角色)
|
||
in: query
|
||
name: available_for_role_type
|
||
schema:
|
||
description: 可用角色类型 (1:平台角色, 2:客户角色)
|
||
maximum: 2
|
||
minimum: 1
|
||
nullable: true
|
||
type: integer
|
||
- description: 父权限ID
|
||
in: query
|
||
name: parent_id
|
||
schema:
|
||
description: 父权限ID
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
- description: 状态
|
||
in: query
|
||
name: status
|
||
schema:
|
||
description: 状态
|
||
maximum: 1
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelPermissionPageResult'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 权限列表
|
||
tags:
|
||
- 权限
|
||
post:
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelCreatePermissionRequest'
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelPermissionResponse'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 创建权限
|
||
tags:
|
||
- 权限
|
||
/api/admin/permissions/{id}:
|
||
delete:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
responses:
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 删除权限
|
||
tags:
|
||
- 权限
|
||
get:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelPermissionResponse'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 获取权限详情
|
||
tags:
|
||
- 权限
|
||
put:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelUpdatePermissionParams'
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelPermissionResponse'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 更新权限
|
||
tags:
|
||
- 权限
|
||
/api/admin/permissions/tree:
|
||
get:
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
items:
|
||
$ref: '#/components/schemas/ModelPermissionTreeNode'
|
||
type: array
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 获取权限树
|
||
tags:
|
||
- 权限
|
||
/api/admin/platform-accounts:
|
||
get:
|
||
parameters:
|
||
- description: 页码
|
||
in: query
|
||
name: page
|
||
schema:
|
||
description: 页码
|
||
minimum: 1
|
||
type: integer
|
||
- description: 每页数量
|
||
in: query
|
||
name: page_size
|
||
schema:
|
||
description: 每页数量
|
||
maximum: 100
|
||
minimum: 1
|
||
type: integer
|
||
- description: 用户名模糊查询
|
||
in: query
|
||
name: username
|
||
schema:
|
||
description: 用户名模糊查询
|
||
maxLength: 50
|
||
type: string
|
||
- description: 手机号模糊查询
|
||
in: query
|
||
name: phone
|
||
schema:
|
||
description: 手机号模糊查询
|
||
maxLength: 20
|
||
type: string
|
||
- description: 状态
|
||
in: query
|
||
name: status
|
||
schema:
|
||
description: 状态
|
||
maximum: 1
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelAccountPageResult'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 平台账号列表
|
||
tags:
|
||
- 平台账号
|
||
post:
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelCreateAccountRequest'
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelAccountResponse'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 新增平台账号
|
||
tags:
|
||
- 平台账号
|
||
/api/admin/platform-accounts/{account_id}/roles/{role_id}:
|
||
delete:
|
||
parameters:
|
||
- description: 账号ID
|
||
in: path
|
||
name: account_id
|
||
required: true
|
||
schema:
|
||
description: 账号ID
|
||
minimum: 0
|
||
type: integer
|
||
- description: 角色ID
|
||
in: path
|
||
name: role_id
|
||
required: true
|
||
schema:
|
||
description: 角色ID
|
||
minimum: 0
|
||
type: integer
|
||
responses:
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 移除角色
|
||
tags:
|
||
- 平台账号
|
||
/api/admin/platform-accounts/{id}:
|
||
delete:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
responses:
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 删除平台账号
|
||
tags:
|
||
- 平台账号
|
||
get:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelAccountResponse'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 获取平台账号详情
|
||
tags:
|
||
- 平台账号
|
||
put:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelUpdateAccountParams'
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelAccountResponse'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 编辑平台账号
|
||
tags:
|
||
- 平台账号
|
||
/api/admin/platform-accounts/{id}/password:
|
||
put:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelUpdatePasswordParams'
|
||
responses:
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 修改密码
|
||
tags:
|
||
- 平台账号
|
||
/api/admin/platform-accounts/{id}/roles:
|
||
get:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
items:
|
||
$ref: '#/components/schemas/ModelRole'
|
||
type: array
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 获取账号角色
|
||
tags:
|
||
- 平台账号
|
||
post:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelAssignRolesParams'
|
||
responses:
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 分配角色
|
||
tags:
|
||
- 平台账号
|
||
/api/admin/platform-accounts/{id}/status:
|
||
put:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelUpdateStatusParams'
|
||
responses:
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 启用/禁用账号
|
||
tags:
|
||
- 平台账号
|
||
/api/admin/refresh-token:
|
||
post:
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelRefreshTokenRequest'
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelRefreshTokenResponse'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
summary: 刷新 Token
|
||
tags:
|
||
- 认证
|
||
/api/admin/roles:
|
||
get:
|
||
parameters:
|
||
- description: 页码
|
||
in: query
|
||
name: page
|
||
schema:
|
||
description: 页码
|
||
minimum: 1
|
||
type: integer
|
||
- description: 每页数量
|
||
in: query
|
||
name: page_size
|
||
schema:
|
||
description: 每页数量
|
||
maximum: 100
|
||
minimum: 1
|
||
type: integer
|
||
- description: 角色名称模糊查询
|
||
in: query
|
||
name: role_name
|
||
schema:
|
||
description: 角色名称模糊查询
|
||
maxLength: 50
|
||
type: string
|
||
- description: 角色类型 (1:平台角色, 2:客户角色)
|
||
in: query
|
||
name: role_type
|
||
schema:
|
||
description: 角色类型 (1:平台角色, 2:客户角色)
|
||
maximum: 2
|
||
minimum: 1
|
||
nullable: true
|
||
type: integer
|
||
- description: 状态
|
||
in: query
|
||
name: status
|
||
schema:
|
||
description: 状态
|
||
maximum: 1
|
||
minimum: 0
|
||
nullable: true
|
||
type: integer
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelRolePageResult'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 角色列表
|
||
tags:
|
||
- 角色
|
||
post:
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelCreateRoleRequest'
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelRoleResponse'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 创建角色
|
||
tags:
|
||
- 角色
|
||
/api/admin/roles/{id}:
|
||
delete:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
responses:
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 删除角色
|
||
tags:
|
||
- 角色
|
||
get:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelRoleResponse'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 获取角色详情
|
||
tags:
|
||
- 角色
|
||
put:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelUpdateRoleParams'
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelRoleResponse'
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 更新角色
|
||
tags:
|
||
- 角色
|
||
/api/admin/roles/{id}/permissions:
|
||
get:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
responses:
|
||
"200":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
items:
|
||
$ref: '#/components/schemas/ModelPermission'
|
||
type: array
|
||
description: OK
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 获取角色权限
|
||
tags:
|
||
- 角色
|
||
post:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelAssignPermissionsParams'
|
||
responses:
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 分配权限
|
||
tags:
|
||
- 角色
|
||
/api/admin/roles/{id}/status:
|
||
put:
|
||
parameters:
|
||
- description: ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
schema:
|
||
description: ID
|
||
minimum: 0
|
||
type: integer
|
||
requestBody:
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ModelUpdateRoleStatusParams'
|
||
responses:
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 更新角色状态
|
||
tags:
|
||
- 角色
|
||
/api/admin/roles/{role_id}/permissions/{perm_id}:
|
||
delete:
|
||
parameters:
|
||
- description: 角色ID
|
||
in: path
|
||
name: role_id
|
||
required: true
|
||
schema:
|
||
description: 角色ID
|
||
minimum: 0
|
||
type: integer
|
||
- description: 权限ID
|
||
in: path
|
||
name: perm_id
|
||
required: true
|
||
schema:
|
||
description: 权限ID
|
||
minimum: 0
|
||
type: integer
|
||
responses:
|
||
"400":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 请求参数错误
|
||
"401":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 未认证或认证已过期
|
||
"403":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 无权访问
|
||
"500":
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
description: 服务器内部错误
|
||
security:
|
||
- BearerAuth: []
|
||
summary: 移除权限
|
||
tags:
|
||
- 角色
|