ci
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3';
|
||||
// import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
|
||||
@Injectable()
|
||||
@@ -7,24 +7,24 @@ export class MinioService {
|
||||
|
||||
constructor(private configService: ConfigService) {}
|
||||
|
||||
private readonly client = new S3Client({
|
||||
region: 'us-east-1',
|
||||
endpoint: this.configService.get('MINIOHOST'),
|
||||
credentials: {
|
||||
accessKeyId: this.configService.get('MINIOUSER'),
|
||||
secretAccessKey: this.configService.get('MINIOACCESSKEY'),
|
||||
},
|
||||
forcePathStyle: true,
|
||||
});
|
||||
// private readonly client = new S3Client({
|
||||
// region: 'us-east-1',
|
||||
// endpoint: this.configService.get('MINIOHOST'),
|
||||
// credentials: {
|
||||
// accessKeyId: this.configService.get('MINIOUSER'),
|
||||
// secretAccessKey: this.configService.get('MINIOACCESSKEY'),
|
||||
// },
|
||||
// forcePathStyle: true,
|
||||
// });
|
||||
|
||||
async uploadPdf(bucket: string, key: string, pdfBuffer: Buffer): Promise<void> {
|
||||
await this.client.send(
|
||||
new PutObjectCommand({
|
||||
Bucket: bucket,
|
||||
Key: key,
|
||||
Body: pdfBuffer,
|
||||
ContentType: 'application/pdf',
|
||||
}),
|
||||
);
|
||||
// await this.client.send(
|
||||
// new PutObjectCommand({
|
||||
// Bucket: bucket,
|
||||
// Key: key,
|
||||
// Body: pdfBuffer,
|
||||
// ContentType: 'application/pdf',
|
||||
// }),
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user