feat(upload): refactor file management with statistics and multi-tab layout

This commit is contained in:
ryan
2026-06-13 12:32:42 +08:00
parent 40e83a832f
commit 04280a7b11
9 changed files with 1339 additions and 248 deletions
+107 -1
View File
@@ -3379,7 +3379,7 @@ const docTemplate = `{
}
},
"500": {
"description": "Redis 异常或构造 URL 失败",
"description": "Redis 异常 or 构造 URL 失败",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
@@ -3830,6 +3830,55 @@ const docTemplate = `{
}
}
},
"/api/v1/upload/stats": {
"get": {
"security": [
{
"SessionCookie": []
}
],
"description": "返回当前用户的总文件数、占用大小、最近 7 天新增趋势、文件类型/格式分布等数据",
"produces": [
"application/json"
],
"tags": [
"upload"
],
"summary": "获取文件统计数据",
"responses": {
"200": {
"description": "获取成功",
"schema": {
"allOf": [
{
"$ref": "#/definitions/util.ResponseAny"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/upload.fileStatsResponse"
}
}
}
]
}
},
"401": {
"description": "未登录",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"500": {
"description": "内部错误",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
}
}
}
},
"/api/v1/upload/{id}": {
"delete": {
"security": [
@@ -5893,6 +5942,49 @@ const docTemplate = `{
}
}
},
"upload.distributionItem": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"name": {
"type": "string"
},
"size": {
"type": "integer"
}
}
},
"upload.fileStatsResponse": {
"type": "object",
"properties": {
"categories": {
"type": "array",
"items": {
"$ref": "#/definitions/upload.distributionItem"
}
},
"total_count": {
"type": "integer"
},
"total_size": {
"type": "integer"
},
"trend": {
"type": "array",
"items": {
"$ref": "#/definitions/upload.trendItem"
}
},
"types": {
"type": "array",
"items": {
"$ref": "#/definitions/upload.distributionItem"
}
}
}
},
"upload.listMyFilesResponse": {
"type": "object",
"properties": {
@@ -5913,6 +6005,20 @@ const docTemplate = `{
}
}
},
"upload.trendItem": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"date": {
"type": "string"
},
"size": {
"type": "integer"
}
}
},
"user.changePasswordRequest": {
"type": "object",
"properties": {