基础功能完成并进行错误修复
This commit is contained in:
294
api/swagger.json
294
api/swagger.json
@@ -284,8 +284,8 @@
|
||||
"summary": "获取批次详情",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "批次 ID",
|
||||
"type": "string",
|
||||
"description": "批次 ID (UUID)",
|
||||
"name": "batch_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
@@ -337,8 +337,8 @@
|
||||
"summary": "修改批次信息",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "批次 ID",
|
||||
"type": "string",
|
||||
"description": "批次 ID (UUID)",
|
||||
"name": "batch_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
@@ -396,8 +396,8 @@
|
||||
"summary": "删除批次",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "批次 ID",
|
||||
"type": "string",
|
||||
"description": "批次 ID (UUID)",
|
||||
"name": "batch_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
@@ -419,6 +419,82 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/config": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"AdminAuth": []
|
||||
}
|
||||
],
|
||||
"description": "获取系统的完整配置文件内容(仅管理员)",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"管理员",
|
||||
"配置"
|
||||
],
|
||||
"summary": "获取完整配置",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/config.Config"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"AdminAuth": []
|
||||
}
|
||||
],
|
||||
"description": "更新系统的配置文件内容(仅管理员)",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"管理员",
|
||||
"配置"
|
||||
],
|
||||
"summary": "更新配置",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "新配置内容",
|
||||
"name": "config",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/config.Config"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.Response"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.Response"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.Response"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/login": {
|
||||
"post": {
|
||||
"description": "通过密码换取 JWT Token",
|
||||
@@ -691,6 +767,38 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/config": {
|
||||
"get": {
|
||||
"description": "获取前端展示所需的非敏感配置数据",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"公共"
|
||||
],
|
||||
"summary": "获取公共配置",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/model.Response"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/public.PublicConfig"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/files/{file_id}/download": {
|
||||
"get": {
|
||||
"description": "根据文件 ID 下载单个文件",
|
||||
@@ -703,8 +811,8 @@
|
||||
"summary": "下载单个文件",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "文件 ID",
|
||||
"type": "string",
|
||||
"description": "文件 ID (UUID)",
|
||||
"name": "file_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
@@ -824,6 +932,149 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"config.APITokenConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"allowAdminAPI": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"maxTokens": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"config.Config": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"apitoken": {
|
||||
"$ref": "#/definitions/config.APITokenConfig"
|
||||
},
|
||||
"database": {
|
||||
"$ref": "#/definitions/config.DatabaseConfig"
|
||||
},
|
||||
"security": {
|
||||
"$ref": "#/definitions/config.SecurityConfig"
|
||||
},
|
||||
"site": {
|
||||
"$ref": "#/definitions/config.SiteConfig"
|
||||
},
|
||||
"storage": {
|
||||
"$ref": "#/definitions/config.StorageConfig"
|
||||
},
|
||||
"upload": {
|
||||
"$ref": "#/definitions/config.UploadConfig"
|
||||
}
|
||||
}
|
||||
},
|
||||
"config.DatabaseConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"config.SecurityConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"adminPasswordHash": {
|
||||
"type": "string"
|
||||
},
|
||||
"jwtsecret": {
|
||||
"type": "string"
|
||||
},
|
||||
"pickupCodeLength": {
|
||||
"type": "integer"
|
||||
},
|
||||
"pickupFailLimit": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"config.SiteConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"config.StorageConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"local": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"s3": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"accessKey": {
|
||||
"type": "string"
|
||||
},
|
||||
"bucket": {
|
||||
"type": "string"
|
||||
},
|
||||
"endpoint": {
|
||||
"type": "string"
|
||||
},
|
||||
"region": {
|
||||
"type": "string"
|
||||
},
|
||||
"secretKey": {
|
||||
"type": "string"
|
||||
},
|
||||
"useSSL": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"webDAV": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"root": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"config.UploadConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"maxBatchFiles": {
|
||||
"type": "integer"
|
||||
},
|
||||
"maxFileSizeMB": {
|
||||
"type": "integer"
|
||||
},
|
||||
"maxRetentionDays": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"model.APIToken": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -876,7 +1127,7 @@
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
"type": "string"
|
||||
},
|
||||
"max_downloads": {
|
||||
"type": "integer"
|
||||
@@ -904,13 +1155,13 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"batch_id": {
|
||||
"type": "integer"
|
||||
"type": "string"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
"type": "string"
|
||||
},
|
||||
"mime_type": {
|
||||
"type": "string"
|
||||
@@ -972,11 +1223,30 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"public.PublicConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"api_token": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"site": {
|
||||
"$ref": "#/definitions/config.SiteConfig"
|
||||
},
|
||||
"upload": {
|
||||
"$ref": "#/definitions/config.UploadConfig"
|
||||
}
|
||||
}
|
||||
},
|
||||
"public.UploadResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"batch_id": {
|
||||
"type": "integer"
|
||||
"type": "string"
|
||||
},
|
||||
"expire_at": {
|
||||
"type": "string"
|
||||
|
||||
Reference in New Issue
Block a user