From 438d7c49624461889f4c06955bd14175c2473263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E6=B2=90?= Date: Sat, 8 Oct 2022 16:21:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=85=BE=E8=AE=AF=E4=BA=91?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/net/maku/storage/properties/TencentStorageProperties.java | 4 +--- .../main/java/net/maku/storage/service/TencentStorageService.java | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/maku-boot-system/src/main/java/net/maku/storage/properties/TencentStorageProperties.java b/maku-boot-system/src/main/java/net/maku/storage/properties/TencentStorageProperties.java index a9f905d..fb8a568 100644 --- a/maku-boot-system/src/main/java/net/maku/storage/properties/TencentStorageProperties.java +++ b/maku-boot-system/src/main/java/net/maku/storage/properties/TencentStorageProperties.java @@ -9,10 +9,8 @@ import lombok.Data; */ @Data public class TencentStorageProperties { - private String appId; - private String region; - private String endPoint; private String accessKey; private String secretKey; + private String region; private String bucketName; } diff --git a/maku-boot-system/src/main/java/net/maku/storage/service/TencentStorageService.java b/maku-boot-system/src/main/java/net/maku/storage/service/TencentStorageService.java index 2c8cc0e..406e1c2 100644 --- a/maku-boot-system/src/main/java/net/maku/storage/service/TencentStorageService.java +++ b/maku-boot-system/src/main/java/net/maku/storage/service/TencentStorageService.java @@ -43,13 +43,10 @@ public class TencentStorageService extends StorageService { try { COSClient cosClient = new COSClient(cred, clientConfig); - // 存储桶名称,格式:BucketName-APPID - String bucketName = properties.getTencent().getBucketName() + "-" + properties.getTencent().getAppId(); - ObjectMetadata metadata = new ObjectMetadata(); metadata.setContentLength(inputStream.available()); - PutObjectRequest request = new PutObjectRequest(bucketName, path, inputStream, metadata); + PutObjectRequest request = new PutObjectRequest(properties.getTencent().getBucketName(), path, inputStream, metadata); PutObjectResult result = cosClient.putObject(request); cosClient.shutdown();