From 8d9a2d656e4ae007590c622e5f7c228adacdca49 Mon Sep 17 00:00:00 2001
From: rain <167982779@qq.com>
Date: Fri, 14 Jun 2024 10:11:36 +0800
Subject: [PATCH] 统一风格
---
src/main/java/com/dji/sample/component/oss/service/impl/MinIOServiceImpl.java | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/dji/sample/component/oss/service/impl/MinIOServiceImpl.java b/src/main/java/com/dji/sample/component/oss/service/impl/MinIOServiceImpl.java
index cafeb66..21024c8 100644
--- a/src/main/java/com/dji/sample/component/oss/service/impl/MinIOServiceImpl.java
+++ b/src/main/java/com/dji/sample/component/oss/service/impl/MinIOServiceImpl.java
@@ -29,7 +29,7 @@
public class MinIOServiceImpl implements IOssService {
private MinioClient client;
-
+
@Override
public String getOssType() {
return OssTypeEnum.MINIO.getType();
@@ -38,7 +38,7 @@
@Override
public CredentialsDTO getCredentials() {
try {
- AssumeRoleProvider provider = new AssumeRoleProvider(OssConfiguration.endpoint, OssConfiguration.accessKey,
+ AssumeRoleProvider provider = new AssumeRoleProvider(OssConfiguration.externalEndpoint, OssConfiguration.accessKey,
OssConfiguration.secretKey, Math.toIntExact(OssConfiguration.expire),
null, OssConfiguration.region, null, null, null, null);
return new CredentialsDTO(provider.fetch(), OssConfiguration.expire);
@@ -63,7 +63,7 @@
} catch (ErrorResponseException | InsufficientDataException | InternalException |
InvalidKeyException | InvalidResponseException | IOException |
NoSuchAlgorithmException | XmlParserException | ServerException e) {
- throw new RuntimeException("The file does not exist on the OssConfiguration.");
+ throw new RuntimeException("OssConfiguration上不存在该文件.");
}
}
@@ -94,9 +94,9 @@
public void putObject(String bucket, String objectKey, InputStream input) {
try {
client.statObject(StatObjectArgs.builder().bucket(bucket).object(objectKey).build());
- throw new RuntimeException("The filename already exists.");
+ throw new RuntimeException("文件名已存在");
} catch (MinioException | InvalidKeyException | IOException | NoSuchAlgorithmException e) {
- log.info("The file does not exist, start uploading.");
+ log.info("文件不存在,开始上传。");
try {
ObjectWriteResponse response = client.putObject(
PutObjectArgs.builder().bucket(bucket).object(objectKey).stream(input, input.available(), 0).build());
--
Gitblit v1.9.3