fix
This commit is contained in:
parent
1380115e72
commit
31da1625f5
@ -12,6 +12,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@ -24,9 +25,6 @@ public class MinioOSGatewayImpl implements ObjectStorageGateway {
|
|||||||
|
|
||||||
private final ObjectStorageProperties objectStorageProperties;
|
private final ObjectStorageProperties objectStorageProperties;
|
||||||
|
|
||||||
@Value("${local.minio.endpoint:http://localhost:19000}")
|
|
||||||
private String localMinioEndpoint;
|
|
||||||
|
|
||||||
public MinioOSGatewayImpl(
|
public MinioOSGatewayImpl(
|
||||||
@Value("${minio.endpoint:http://s3.wisdompulse.cn}") String endpoint,
|
@Value("${minio.endpoint:http://s3.wisdompulse.cn}") String endpoint,
|
||||||
@Value("${minio.access-key:lukeye}") String accessKey,
|
@Value("${minio.access-key:lukeye}") String accessKey,
|
||||||
@ -38,8 +36,9 @@ public class MinioOSGatewayImpl implements ObjectStorageGateway {
|
|||||||
.credentials(accessKey, secretKey)
|
.credentials(accessKey, secretKey)
|
||||||
.build();
|
.build();
|
||||||
// 为了提升上传的速度,创建本地 minio 客户端
|
// 为了提升上传的速度,创建本地 minio 客户端
|
||||||
|
String activeProfile = System.getProperty("spring.profiles.active", "docker");
|
||||||
this.localMinioClient = MinioClient.builder()
|
this.localMinioClient = MinioClient.builder()
|
||||||
.endpoint(localMinioEndpoint)
|
.endpoint(Set.of("windows", "docker").contains(activeProfile) ? "http://localhost:9000" : "http://s3.wisdompulse.cn")
|
||||||
.credentials(accessKey, secretKey)
|
.credentials(accessKey, secretKey)
|
||||||
.build();
|
.build();
|
||||||
this.objectStorageProperties = objectStorageProperties;
|
this.objectStorageProperties = objectStorageProperties;
|
||||||
|
|||||||
@ -41,6 +41,3 @@ mybatis-plus.global-config.db-config.id-type=auto
|
|||||||
|
|
||||||
# Redis 开关控制
|
# Redis 开关控制
|
||||||
knowledge.base.redis.enable=false
|
knowledge.base.redis.enable=false
|
||||||
|
|
||||||
# 对象存储相关
|
|
||||||
local.minio.endpoint=http://s3.wisdompulse.cn
|
|
||||||
Loading…
x
Reference in New Issue
Block a user