添加前端页面以及相关打包脚本和内置 web 的逻辑

This commit is contained in:
2026-01-14 23:09:16 +08:00
parent e456d3a823
commit 9b646321e1
45 changed files with 583 additions and 10 deletions

View File

@@ -855,7 +855,7 @@ const docTemplate = `{
"APITokenAuth": []
}
],
"description": "根据文件 ID 下载单个文件。可选提供带 pickup scope 的 API Token。",
"description": "根据文件 ID 下载单个文件。支持直观的文件名结尾以方便下载工具识别。可选提供带 pickup scope 的 API Token。",
"produces": [
"application/octet-stream"
],
@@ -893,6 +893,58 @@ const docTemplate = `{
}
}
}
},
"/api/files/{file_id}/{filename}": {
"get": {
"security": [
{
"APITokenAuth": []
}
],
"description": "根据文件 ID 下载单个文件。支持直观的文件名结尾以方便下载工具识别。可选提供带 pickup scope 的 API Token。",
"produces": [
"application/octet-stream"
],
"tags": [
"Public"
],
"summary": "下载单个文件",
"parameters": [
{
"type": "string",
"description": "文件 ID (UUID)",
"name": "file_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "文件名",
"name": "filename",
"in": "path"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "file"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/model.Response"
}
},
"410": {
"description": "Gone",
"schema": {
"$ref": "#/definitions/model.Response"
}
}
}
}
}
},
"definitions": {
@@ -969,6 +1021,9 @@ const docTemplate = `{
"admin.UpdateBatchRequest": {
"type": "object",
"properties": {
"download_count": {
"type": "integer"
},
"expire_at": {
"type": "string"
},
@@ -1068,6 +1123,10 @@ const docTemplate = `{
"config.SecurityConfig": {
"type": "object",
"properties": {
"admin_password": {
"description": "管理员密码明文 (仅用于更新请求,不保存到文件)",
"type": "string"
},
"admin_password_hash": {
"description": "管理员密码哈希 (bcrypt)",
"type": "string"
@@ -1277,6 +1336,9 @@ const docTemplate = `{
"created_at": {
"type": "string"
},
"download_url": {
"type": "string"
},
"id": {
"type": "string"
},