mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
perf: 七牛oss支持删除过期备份
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user