文件管理权限控制

This commit is contained in:
ryan
2026-06-11 13:58:45 +08:00
parent 312bc7d4d5
commit 5e0de01c4b
18 changed files with 993 additions and 337 deletions
+64 -3
View File
@@ -2353,6 +2353,64 @@ const docTemplate = `{
}
}
},
"/api/v1/admin/uploads/types": {
"get": {
"security": [
{
"SessionCookie": []
}
],
"description": "返回系统中所有已上传文件所拥有的业务类型,并合并默认内置类型(avatar, attachment, doc, generic)",
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "获取文件业务类型列表",
"responses": {
"200": {
"description": "业务类型列表",
"schema": {
"allOf": [
{
"$ref": "#/definitions/util.ResponseAny"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
]
}
},
"401": {
"description": "未登录",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"403": {
"description": "无管理员权限",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"500": {
"description": "内部错误",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
}
}
}
},
"/api/v1/admin/users": {
"get": {
"security": [
@@ -4185,6 +4243,12 @@ const docTemplate = `{
"$ref": "#/definitions/util.ResponseAny"
}
},
"401": {
"description": "未登录",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"404": {
"description": "文件未找到",
"schema": {
@@ -4559,9 +4623,6 @@ const docTemplate = `{
"is_admin": {
"type": "boolean"
},
"last_used_at": {
"type": "string"
},
"masked_token": {
"type": "string"
},
+64 -3
View File
@@ -2346,6 +2346,64 @@
}
}
},
"/api/v1/admin/uploads/types": {
"get": {
"security": [
{
"SessionCookie": []
}
],
"description": "返回系统中所有已上传文件所拥有的业务类型,并合并默认内置类型(avatar, attachment, doc, generic)",
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "获取文件业务类型列表",
"responses": {
"200": {
"description": "业务类型列表",
"schema": {
"allOf": [
{
"$ref": "#/definitions/util.ResponseAny"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
]
}
},
"401": {
"description": "未登录",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"403": {
"description": "无管理员权限",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"500": {
"description": "内部错误",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
}
}
}
},
"/api/v1/admin/users": {
"get": {
"security": [
@@ -4178,6 +4236,12 @@
"$ref": "#/definitions/util.ResponseAny"
}
},
"401": {
"description": "未登录",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"404": {
"description": "文件未找到",
"schema": {
@@ -4552,9 +4616,6 @@
"is_admin": {
"type": "boolean"
},
"last_used_at": {
"type": "string"
},
"masked_token": {
"type": "string"
},
+38 -2
View File
@@ -222,8 +222,6 @@ definitions:
type: integer
is_admin:
type: boolean
last_used_at:
type: string
masked_token:
type: string
name:
@@ -2418,6 +2416,40 @@ paths:
summary: 更新模板
tags:
- admin
/api/v1/admin/uploads/types:
get:
description: 返回系统中所有已上传文件所拥有的业务类型,并合并默认内置类型(avatar, attachment, doc, generic)
produces:
- application/json
responses:
"200":
description: 业务类型列表
schema:
allOf:
- $ref: '#/definitions/util.ResponseAny'
- properties:
data:
items:
type: string
type: array
type: object
"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:
get:
description: 分页返回用户列表,支持按用户 ID 和用户名筛选,需要管理员权限
@@ -3512,6 +3544,10 @@ paths:
description: 文件 ID 格式错误
schema:
$ref: '#/definitions/util.ResponseAny'
"401":
description: 未登录
schema:
$ref: '#/definitions/util.ResponseAny'
"404":
description: 文件未找到
schema: