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": {
+107 -1
View File
@@ -3372,7 +3372,7 @@
}
},
"500": {
"description": "Redis 异常或构造 URL 失败",
"description": "Redis 异常 or 构造 URL 失败",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
@@ -3823,6 +3823,55 @@
}
}
},
"/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": [
@@ -5886,6 +5935,49 @@
}
}
},
"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": {
@@ -5906,6 +5998,20 @@
}
}
},
"upload.trendItem": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"date": {
"type": "string"
},
"size": {
"type": "integer"
}
}
},
"user.changePasswordRequest": {
"type": "object",
"properties": {
+66 -1
View File
@@ -899,6 +899,34 @@ definitions:
required:
- ids
type: object
upload.distributionItem:
properties:
count:
type: integer
name:
type: string
size:
type: integer
type: object
upload.fileStatsResponse:
properties:
categories:
items:
$ref: '#/definitions/upload.distributionItem'
type: array
total_count:
type: integer
total_size:
type: integer
trend:
items:
$ref: '#/definitions/upload.trendItem'
type: array
types:
items:
$ref: '#/definitions/upload.distributionItem'
type: array
type: object
upload.listMyFilesResponse:
properties:
items:
@@ -912,6 +940,15 @@ definitions:
total:
type: integer
type: object
upload.trendItem:
properties:
count:
type: integer
date:
type: string
size:
type: integer
type: object
user.changePasswordRequest:
properties:
new_password:
@@ -3129,7 +3166,7 @@ paths:
schema:
$ref: '#/definitions/util.ResponseAny'
"500":
description: Redis 异常或构造 URL 失败
description: Redis 异常 or 构造 URL 失败
schema:
$ref: '#/definitions/util.ResponseAny'
summary: 获取登录授权地址
@@ -3394,6 +3431,34 @@ paths:
summary: 获取我的文件列表
tags:
- upload
/api/v1/upload/stats:
get:
description: 返回当前用户的总文件数、占用大小、最近 7 天新增趋势、文件类型/格式分布等数据
produces:
- application/json
responses:
"200":
description: 获取成功
schema:
allOf:
- $ref: '#/definitions/util.ResponseAny'
- properties:
data:
$ref: '#/definitions/upload.fileStatsResponse'
type: object
"401":
description: 未登录
schema:
$ref: '#/definitions/util.ResponseAny'
"500":
description: 内部错误
schema:
$ref: '#/definitions/util.ResponseAny'
security:
- SessionCookie: []
summary: 获取文件统计数据
tags:
- upload
/api/v1/user-info:
get:
description: 返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。