添加前端页面以及相关打包脚本和内置 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"
},

View File

@@ -848,7 +848,7 @@
"APITokenAuth": []
}
],
"description": "根据文件 ID 下载单个文件。可选提供带 pickup scope 的 API Token。",
"description": "根据文件 ID 下载单个文件。支持直观的文件名结尾以方便下载工具识别。可选提供带 pickup scope 的 API Token。",
"produces": [
"application/octet-stream"
],
@@ -886,6 +886,58 @@
}
}
}
},
"/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": {
@@ -962,6 +1014,9 @@
"admin.UpdateBatchRequest": {
"type": "object",
"properties": {
"download_count": {
"type": "integer"
},
"expire_at": {
"type": "string"
},
@@ -1061,6 +1116,10 @@
"config.SecurityConfig": {
"type": "object",
"properties": {
"admin_password": {
"description": "管理员密码明文 (仅用于更新请求,不保存到文件)",
"type": "string"
},
"admin_password_hash": {
"description": "管理员密码哈希 (bcrypt)",
"type": "string"
@@ -1270,6 +1329,9 @@
"created_at": {
"type": "string"
},
"download_url": {
"type": "string"
},
"id": {
"type": "string"
},

View File

@@ -48,6 +48,8 @@ definitions:
type: object
admin.UpdateBatchRequest:
properties:
download_count:
type: integer
expire_at:
type: string
expire_type:
@@ -106,6 +108,9 @@ definitions:
type: object
config.SecurityConfig:
properties:
admin_password:
description: 管理员密码明文 (仅用于更新请求,不保存到文件)
type: string
admin_password_hash:
description: 管理员密码哈希 (bcrypt)
type: string
@@ -251,6 +256,8 @@ definitions:
type: string
created_at:
type: string
download_url:
type: string
id:
type: string
mime_type:
@@ -854,9 +861,42 @@ paths:
summary: 获取公共配置
tags:
- Public
/api/files/{file_id}/{filename}:
get:
description: 根据文件 ID 下载单个文件。支持直观的文件名结尾以方便下载工具识别。可选提供带 pickup scope 的 API Token。
parameters:
- description: 文件 ID (UUID)
in: path
name: file_id
required: true
type: string
- description: 文件名
in: path
name: filename
type: string
produces:
- application/octet-stream
responses:
"200":
description: OK
schema:
type: file
"404":
description: Not Found
schema:
$ref: '#/definitions/model.Response'
"410":
description: Gone
schema:
$ref: '#/definitions/model.Response'
security:
- APITokenAuth: []
summary: 下载单个文件
tags:
- Public
/api/files/{file_id}/download:
get:
description: 根据文件 ID 下载单个文件。可选提供带 pickup scope 的 API Token。
description: 根据文件 ID 下载单个文件。支持直观的文件名结尾以方便下载工具识别。可选提供带 pickup scope 的 API Token。
parameters:
- description: 文件 ID (UUID)
in: path