更新管理员相关接口
This commit is contained in:
@@ -921,6 +921,148 @@ paths:
|
||||
active_printers:
|
||||
type: integer
|
||||
|
||||
/cloudprint.AdminService/CreateAdmin:
|
||||
post:
|
||||
tags: [Admin]
|
||||
summary: 创建管理员账号
|
||||
description: 创建新的管理员账号,密码将使用bcrypt进行哈希处理
|
||||
security:
|
||||
- bearerAuth: []
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- username
|
||||
- password
|
||||
properties:
|
||||
username:
|
||||
type: string
|
||||
description: 管理员用户名
|
||||
example: "admin"
|
||||
password:
|
||||
type: string
|
||||
description: 管理员密码
|
||||
example: "admin123"
|
||||
nickname:
|
||||
type: string
|
||||
description: 昵称
|
||||
example: "管理员"
|
||||
role:
|
||||
type: integer
|
||||
description: 角色 (1-普通管理员, 2-超级管理员)
|
||||
example: 1
|
||||
responses:
|
||||
"200":
|
||||
description: 创建成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
admin:
|
||||
$ref: '#/components/schemas/Admin'
|
||||
|
||||
/cloudprint.AdminService/GetAdminList:
|
||||
post:
|
||||
tags: [Admin]
|
||||
summary: 获取管理员列表
|
||||
security:
|
||||
- bearerAuth: []
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
page:
|
||||
type: integer
|
||||
description: 页码
|
||||
example: 1
|
||||
page_size:
|
||||
type: integer
|
||||
description: 每页数量
|
||||
example: 10
|
||||
responses:
|
||||
"200":
|
||||
description: 成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
admins:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Admin'
|
||||
total:
|
||||
type: integer
|
||||
description: 总数
|
||||
|
||||
/cloudprint.AdminService/UpdateAdmin:
|
||||
post:
|
||||
tags: [Admin]
|
||||
summary: 更新管理员信息
|
||||
security:
|
||||
- bearerAuth: []
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
description: 管理员ID
|
||||
example: 1
|
||||
nickname:
|
||||
type: string
|
||||
description: 昵称
|
||||
example: "新昵称"
|
||||
role:
|
||||
type: integer
|
||||
description: 角色 (1-普通管理员, 2-超级管理员)
|
||||
example: 2
|
||||
responses:
|
||||
"200":
|
||||
description: 更新成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Admin'
|
||||
|
||||
/cloudprint.AdminService/DeleteAdmin:
|
||||
post:
|
||||
tags: [Admin]
|
||||
summary: 删除管理员
|
||||
security:
|
||||
- bearerAuth: []
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
description: 管理员ID
|
||||
example: 1
|
||||
responses:
|
||||
"200":
|
||||
description: 删除成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
bearerAuth:
|
||||
|
||||
Reference in New Issue
Block a user