完善大文件备份分卷上传与恢复

This commit is contained in:
lyen1688 authored and lyen1688 committed 2026-08-09 20:58:07 +08:00
1 parent 48eb3766d2
commit bbc8b6e906
12 files changed
+1420 -156

No files matched your search

+21 -2
View File
@@ -23,6 +23,7 @@ export interface BackupRecord {
backup_type: string
file_name: string
s3_key: string
parts?: BackupPart[]
size_bytes: number
triggered_by: string
error_message?: string
@@ -35,6 +36,24 @@ export interface BackupRecord {
restored_at?: string
}
export interface BackupPart {
index: number
s3_key: string
size_bytes: number
sha256?: string
}
export interface BackupDownloadPart {
index: number
size_bytes: number
url: string
}
export interface BackupDownloadResponse {
url?: string
parts?: BackupDownloadPart[]
}
export interface CreateBackupRequest {
expire_days?: number
}
@@ -137,8 +156,8 @@ export async function deleteBackup(id: string): Promise<void> {
await apiClient.delete(`/admin/backups/${id}`)
}
export async function getDownloadURL(id: string): Promise<{ url: string }> {
const { data } = await apiClient.get<{ url: string }>(`/admin/backups/${id}/download-url`)
export async function getDownloadURL(id: string): Promise<BackupDownloadResponse> {
const { data } = await apiClient.get<BackupDownloadResponse>(`/admin/backups/${id}/download-url`)
return data
}