This commit is contained in:
luke 2025-06-21 01:25:27 +08:00
parent 06c3882190
commit 9360afa83b

View File

@ -37,8 +37,14 @@ public class MinioOSGatewayImpl implements ObjectStorageGateway {
.build(); .build();
// 为了提升上传的速度创建本地 minio 客户端 // 为了提升上传的速度创建本地 minio 客户端
String activeProfile = System.getProperty("spring.profiles.active", "docker"); String activeProfile = System.getProperty("spring.profiles.active", "docker");
String localEndPoint = "http://localhost:19000";
if("docker".equals(activeProfile)) {
localEndPoint = "http://host.docker.internal:19000";
}else if("mac".equals(activeProfile)) {
localEndPoint = "http://s3.wisdompulse.cn";
}
this.localMinioClient = MinioClient.builder() this.localMinioClient = MinioClient.builder()
.endpoint(Set.of("windows", "docker").contains(activeProfile) ? "http://localhost:19000" : "http://s3.wisdompulse.cn") .endpoint(localEndPoint)
.credentials(accessKey, secretKey) .credentials(accessKey, secretKey)
.build(); .build();
this.objectStorageProperties = objectStorageProperties; this.objectStorageProperties = objectStorageProperties;