perf: 七牛oss支持删除过期备份

This commit is contained in:
xiaojunnuo
2025-04-25 18:36:49 +08:00
parent 0088929622
commit b7113bda23
5 changed files with 69 additions and 20 deletions

View File

@@ -12,14 +12,20 @@ export default class QiniuOssClientImpl extends BaseOssClient<QiniuOssAccess> {
});
}
download(fileName: string, savePath: string): Promise<void> {
throw new Error("Method not implemented.");
async download(fileName: string, savePath: string): Promise<void> {
const path = this.join(this.rootDir, fileName);
await this.client.downloadFile(this.access.bucket, path, savePath);
}
removeBy(removeByOpts: OssClientRemoveByOpts): Promise<void> {
throw new Error("Method not implemented.");
}
listDir(dir: string): Promise<OssFileItem[]> {
throw new Error("Method not implemented.");
async listDir(dir: string): Promise<OssFileItem[]> {
const path = this.join(this.rootDir, dir);
const res = await this.client.listDir(this.access.bucket, path);
return res.items.map(item => {
return {
path: item.name,
size: item.fsize,
lastModified: item.putTime,
};
});
}
async upload(filePath: string, fileContent: Buffer) {
const path = this.join(this.rootDir, filePath);