diff --git a/packages/server/src/helpers/aliyun.helper.ts b/packages/server/src/helpers/aliyun.helper.ts deleted file mode 100644 index fd92fae2..00000000 --- a/packages/server/src/helpers/aliyun.helper.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { ConfigService } from '@nestjs/config'; -import * as AliyunOSS from 'ali-oss'; - -export class AliyunOssClient { - configService: ConfigService; - - constructor(config) { - this.configService = config; - } - - private async buildClient() { - const config = this.configService.get('oss.aliyun'); - return new AliyunOSS(config); - } - - async putFile(filepath: string, buffer: ReadableStream) { - const client = await this.buildClient(); - const { url } = await client.put(filepath, buffer); - return url; - } - - async deleteFile(url: string) { - const client = await this.buildClient(); - await client.delete(url); - } -}