This commit is contained in:
ryan
2026-06-08 20:08:14 +08:00
parent 02f458856d
commit cd3d0c9f82
61 changed files with 2180 additions and 1891 deletions
+105 -68
View File
@@ -926,74 +926,6 @@ const docTemplate = `{
}
}
}
},
"delete": {
"security": [
{
"SessionCookie": []
}
],
"description": "根据配置键删除对应配置,同时从 Redis 中移除对应缓存,需要管理员权限",
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "删除系统配置",
"parameters": [
{
"type": "string",
"description": "配置键",
"name": "key",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "删除成功",
"schema": {
"allOf": [
{
"$ref": "#/definitions/util.ResponseAny"
},
{
"type": "object",
"properties": {
"data": {
"type": "string"
}
}
}
]
}
},
"401": {
"description": "未登录",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"403": {
"description": "无管理员权限",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"404": {
"description": "配置不存在",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"500": {
"description": "内部错误",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
}
}
}
},
"/api/v1/admin/tasks/dispatch": {
@@ -3082,6 +3014,64 @@ const docTemplate = `{
}
}
},
"/api/v1/user/profile": {
"put": {
"description": "修改当前登录用户的昵称、邮箱、头像、简介、电话、性别、个人网站和所在地。",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "修改当前登录用户的个人资料",
"parameters": [
{
"description": "更新请求参数",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/user.updateProfileRequest"
}
}
],
"responses": {
"200": {
"description": "修改成功,返回更新后的用户信息",
"schema": {
"allOf": [
{
"$ref": "#/definitions/util.ResponseAny"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/oauth.BasicUserInfo"
}
}
}
]
}
},
"400": {
"description": "邮箱已被占用或参数错误",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"401": {
"description": "未登录",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
}
}
}
},
"/api/v1/user/register": {
"post": {
"description": "使用用户名和密码注册新账号,注册成功后自动登录并建立 Session。密码长度不能少于 8 位。",
@@ -3756,20 +3746,38 @@ const docTemplate = `{
"avatar_url": {
"type": "string"
},
"bio": {
"type": "string"
},
"email": {
"type": "string"
},
"gender": {
"type": "string"
},
"id": {
"type": "integer"
},
"is_admin": {
"type": "boolean"
},
"location": {
"type": "string"
},
"need_change_password": {
"type": "boolean"
},
"nickname": {
"type": "string"
},
"phone": {
"type": "string"
},
"username": {
"type": "string"
},
"website": {
"type": "string"
}
}
},
@@ -4296,6 +4304,35 @@ const docTemplate = `{
}
}
},
"user.updateProfileRequest": {
"type": "object",
"properties": {
"avatar_url": {
"type": "string"
},
"bio": {
"type": "string"
},
"email": {
"type": "string"
},
"gender": {
"type": "string"
},
"location": {
"type": "string"
},
"nickname": {
"type": "string"
},
"phone": {
"type": "string"
},
"website": {
"type": "string"
}
}
},
"user.updateUserStatusRequest": {
"type": "object",
"properties": {
+105 -68
View File
@@ -919,74 +919,6 @@
}
}
}
},
"delete": {
"security": [
{
"SessionCookie": []
}
],
"description": "根据配置键删除对应配置,同时从 Redis 中移除对应缓存,需要管理员权限",
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "删除系统配置",
"parameters": [
{
"type": "string",
"description": "配置键",
"name": "key",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "删除成功",
"schema": {
"allOf": [
{
"$ref": "#/definitions/util.ResponseAny"
},
{
"type": "object",
"properties": {
"data": {
"type": "string"
}
}
}
]
}
},
"401": {
"description": "未登录",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"403": {
"description": "无管理员权限",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"404": {
"description": "配置不存在",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"500": {
"description": "内部错误",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
}
}
}
},
"/api/v1/admin/tasks/dispatch": {
@@ -3075,6 +3007,64 @@
}
}
},
"/api/v1/user/profile": {
"put": {
"description": "修改当前登录用户的昵称、邮箱、头像、简介、电话、性别、个人网站和所在地。",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "修改当前登录用户的个人资料",
"parameters": [
{
"description": "更新请求参数",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/user.updateProfileRequest"
}
}
],
"responses": {
"200": {
"description": "修改成功,返回更新后的用户信息",
"schema": {
"allOf": [
{
"$ref": "#/definitions/util.ResponseAny"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/oauth.BasicUserInfo"
}
}
}
]
}
},
"400": {
"description": "邮箱已被占用或参数错误",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"401": {
"description": "未登录",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
}
}
}
},
"/api/v1/user/register": {
"post": {
"description": "使用用户名和密码注册新账号,注册成功后自动登录并建立 Session。密码长度不能少于 8 位。",
@@ -3749,20 +3739,38 @@
"avatar_url": {
"type": "string"
},
"bio": {
"type": "string"
},
"email": {
"type": "string"
},
"gender": {
"type": "string"
},
"id": {
"type": "integer"
},
"is_admin": {
"type": "boolean"
},
"location": {
"type": "string"
},
"need_change_password": {
"type": "boolean"
},
"nickname": {
"type": "string"
},
"phone": {
"type": "string"
},
"username": {
"type": "string"
},
"website": {
"type": "string"
}
}
},
@@ -4289,6 +4297,35 @@
}
}
},
"user.updateProfileRequest": {
"type": "object",
"properties": {
"avatar_url": {
"type": "string"
},
"bio": {
"type": "string"
},
"email": {
"type": "string"
},
"gender": {
"type": "string"
},
"location": {
"type": "string"
},
"nickname": {
"type": "string"
},
"phone": {
"type": "string"
},
"website": {
"type": "string"
}
}
},
"user.updateUserStatusRequest": {
"type": "object",
"properties": {
+66 -41
View File
@@ -355,16 +355,28 @@ definitions:
properties:
avatar_url:
type: string
bio:
type: string
email:
type: string
gender:
type: string
id:
type: integer
is_admin:
type: boolean
location:
type: string
need_change_password:
type: boolean
nickname:
type: string
phone:
type: string
username:
type: string
website:
type: string
type: object
oauth.CallbackRequest:
properties:
@@ -722,6 +734,25 @@ definitions:
token:
type: string
type: object
user.updateProfileRequest:
properties:
avatar_url:
type: string
bio:
type: string
email:
type: string
gender:
type: string
location:
type: string
nickname:
type: string
phone:
type: string
website:
type: string
type: object
user.updateUserStatusRequest:
properties:
is_active:
@@ -1186,47 +1217,6 @@ paths:
tags:
- admin
/api/v1/admin/system-configs/{key}:
delete:
description: 根据配置键删除对应配置,同时从 Redis 中移除对应缓存,需要管理员权限
parameters:
- description: 配置键
in: path
name: key
required: true
type: string
produces:
- application/json
responses:
"200":
description: 删除成功
schema:
allOf:
- $ref: '#/definitions/util.ResponseAny'
- properties:
data:
type: string
type: object
"401":
description: 未登录
schema:
$ref: '#/definitions/util.ResponseAny'
"403":
description: 无管理员权限
schema:
$ref: '#/definitions/util.ResponseAny'
"404":
description: 配置不存在
schema:
$ref: '#/definitions/util.ResponseAny'
"500":
description: 内部错误
schema:
$ref: '#/definitions/util.ResponseAny'
security:
- SessionCookie: []
summary: 删除系统配置
tags:
- admin
get:
description: 根据配置键获取对应的系统配置详情,需要管理员权限
parameters:
@@ -2602,6 +2592,41 @@ paths:
summary: 用户退出登录
tags:
- user
/api/v1/user/profile:
put:
consumes:
- application/json
description: 修改当前登录用户的昵称、邮箱、头像、简介、电话、性别、个人网站和所在地。
parameters:
- description: 更新请求参数
in: body
name: request
required: true
schema:
$ref: '#/definitions/user.updateProfileRequest'
produces:
- application/json
responses:
"200":
description: 修改成功,返回更新后的用户信息
schema:
allOf:
- $ref: '#/definitions/util.ResponseAny'
- properties:
data:
$ref: '#/definitions/oauth.BasicUserInfo'
type: object
"400":
description: 邮箱已被占用或参数错误
schema:
$ref: '#/definitions/util.ResponseAny'
"401":
description: 未登录
schema:
$ref: '#/definitions/util.ResponseAny'
summary: 修改当前登录用户的个人资料
tags:
- user
/api/v1/user/register:
post:
consumes: