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
+29
View File
@@ -59,4 +59,33 @@ export interface ListUploadsResponse {
page: number
page_size: number
items: Upload[]
}
/**
* 近 7 天新增文件趋势项
*/
export interface TrendItem {
date: string
count: number
size: number
}
/**
* 文件分类/类型统计项
*/
export interface DistributionItem {
name: string
count: number
size: number
}
/**
* 文件统计信息响应
*/
export interface FileStatsResponse {
total_count: number
total_size: number
trend: TrendItem[]
categories: DistributionItem[]
types: DistributionItem[]
}
@@ -1,5 +1,5 @@
import {BaseService} from '../core/base.service'
import type {ListUploadsResponse, Upload, UploadImageResponse} from './types'
import type {ListUploadsResponse, Upload, UploadImageResponse, FileStatsResponse} from './types'
import type {InternalAxiosRequestConfig} from 'axios'
export type ImageQuality = 'low' | 'medium' | 'high' | 'origin'
@@ -86,6 +86,13 @@ export class UploadService extends BaseService {
return this.get<ListUploadsResponse>('/my', params)
}
/**
* 获取当前用户文件统计信息
*/
static async getFileStats(): Promise<FileStatsResponse> {
return this.get<FileStatsResponse>('/stats')
}
/**
* 删除文件
*/