mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-08 16:46:37 +08:00
feat(upload): refactor file management with statistics and multi-tab layout
This commit is contained in:
@@ -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')
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user