Implement s3 storage.

Use uuid as file id.
This commit is contained in:
2025-05-13 11:56:22 +08:00
parent 081b547c03
commit 04d679f3f4
14 changed files with 145 additions and 76 deletions

View File

@@ -488,7 +488,7 @@ class Network {
}
}
async getFile(fileId: number): Promise<Response<RFile>> {
async getFile(fileId: string): Promise<Response<RFile>> {
try {
const response = await axios.get(`${this.apiBaseUrl}/files/${fileId}`);
return response.data;
@@ -501,7 +501,7 @@ class Network {
}
}
async updateFile(fileId: number, filename: string, description: string): Promise<Response<RFile>> {
async updateFile(fileId: string, filename: string, description: string): Promise<Response<RFile>> {
try {
const response = await axios.put(`${this.apiBaseUrl}/files/${fileId}`, {
filename,
@@ -530,7 +530,7 @@ class Network {
}
}
getFileDownloadLink(fileId: number): string {
getFileDownloadLink(fileId: string): string {
return `${this.apiBaseUrl}/files/download/${fileId}`;
}
}