This commit is contained in:
ryan
2026-06-08 08:19:22 +08:00
parent 4b72419a96
commit 9d0f9f0576
42 changed files with 1412 additions and 809 deletions
+109 -54
View File
@@ -156,20 +156,6 @@ definitions:
- TaskExecutionStatusRunning
- TaskExecutionStatusSucceeded
- TaskExecutionStatusFailed
model.TrustLevel:
enum:
- 0
- 1
- 2
- 3
- 4
type: integer
x-enum-varnames:
- TrustLevelNewUser
- TrustLevelBasicUser
- TrustLevelUser
- TrustLevelActiveUser
- TrustLevelLeader
model.Upload:
properties:
created_at:
@@ -276,38 +262,16 @@ definitions:
type: object
oauth.BasicUserInfo:
properties:
available_balance:
type: number
avatar_url:
type: string
community_balance:
type: number
daily_limit:
type: integer
id:
type: integer
is_admin:
type: boolean
need_change_password:
type: boolean
nickname:
type: string
pay_level:
type: string
pay_score:
type: integer
pending_balance:
type: number
remain_quota:
type: number
total_community:
type: number
total_payment:
type: number
total_receive:
type: number
total_transfer:
type: number
trust_level:
$ref: '#/definitions/model.TrustLevel'
username:
type: string
type: object
@@ -421,11 +385,39 @@ definitions:
total:
type: integer
type: object
user.changePasswordRequest:
properties:
new_password:
type: string
old_password:
type: string
type: object
user.createTokenRequest:
properties:
name:
type: string
type: object
user.createUserRequest:
properties:
is_active:
type: boolean
is_admin:
type: boolean
nickname:
maxLength: 64
type: string
password:
maxLength: 64
minLength: 8
type: string
username:
maxLength: 64
minLength: 3
type: string
required:
- password
- username
type: object
user.listUsersResponse:
properties:
total:
@@ -467,12 +459,8 @@ definitions:
type: object
user.user:
properties:
available_balance:
type: number
avatar_url:
type: string
community_balance:
type: number
created_at:
type: string
id:
@@ -485,18 +473,6 @@ definitions:
type: string
nickname:
type: string
pay_score:
type: integer
total_community:
type: number
total_payment:
type: number
total_receive:
type: number
total_transfer:
type: number
trust_level:
$ref: '#/definitions/model.TrustLevel'
updated_at:
type: string
username:
@@ -1208,6 +1184,50 @@ paths:
summary: 获取用户列表
tags:
- admin
post:
consumes:
- application/json
description: 创建一个本地密码登录的新用户,需要管理员权限
parameters:
- description: 创建用户参数
in: body
name: request
required: true
schema:
$ref: '#/definitions/user.createUserRequest'
produces:
- application/json
responses:
"200":
description: 创建成功
schema:
allOf:
- $ref: '#/definitions/util.ResponseAny'
- properties:
data:
$ref: '#/definitions/user.user'
type: object
"400":
description: 参数错误或用户名已存在
schema:
$ref: '#/definitions/util.ResponseAny'
"401":
description: 未登录
schema:
$ref: '#/definitions/util.ResponseAny'
"403":
description: 无管理员权限
schema:
$ref: '#/definitions/util.ResponseAny'
"500":
description: 内部错误
schema:
$ref: '#/definitions/util.ResponseAny'
security:
- SessionCookie: []
summary: 创建用户
tags:
- admin
/api/v1/admin/users/{id}/status:
put:
consumes:
@@ -1838,6 +1858,41 @@ paths:
summary: 轮换一个 AccessToken
tags:
- user
/api/v1/user/change-password:
post:
consumes:
- application/json
description: 修改当前登录用户的密码。修改成功后,如果是首次明文登录的升级提示,则清除修改密码的提示状态。
parameters:
- description: 修改密码请求参数
in: body
name: request
required: true
schema:
$ref: '#/definitions/user.changePasswordRequest'
produces:
- application/json
responses:
"200":
description: 修改密码成功
schema:
allOf:
- $ref: '#/definitions/util.ResponseAny'
- properties:
data:
type: string
type: object
"400":
description: 原密码错误或新密码不符合要求
schema:
$ref: '#/definitions/util.ResponseAny'
"401":
description: 请先登录
schema:
$ref: '#/definitions/util.ResponseAny'
summary: 修改用户密码
tags:
- user
/api/v1/user/login:
post:
consumes: