mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-15 23:23:43 +08:00
fix:优化
This commit is contained in:
@@ -2,13 +2,15 @@ package com.abin.mallchat.oss;
|
||||
|
||||
import io.minio.MinioClient;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.boot.autoconfigure.condition.*;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass({MinioClient.class})
|
||||
@EnableConfigurationProperties(OssProperties.class)
|
||||
@ConditionalOnExpression("${oss.enabled}")
|
||||
@ConditionalOnProperty(value = "oss.type", havingValue = "minio")
|
||||
|
||||
@@ -65,7 +65,6 @@ public class MinIOTemplate {
|
||||
public void makeBucket(String bucketName) {
|
||||
if (!bucketExists(bucketName)) {
|
||||
minioClient.makeBucket(MakeBucketArgs.builder().bucket(bucketName).build());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +79,7 @@ public class MinIOTemplate {
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回临时带签名、过期时间一天、Get请求方式的访问URL
|
||||
* 返回临时带签名、过期时间一天、PUT请求方式的访问URL
|
||||
*/
|
||||
@SneakyThrows
|
||||
public OssResp getPreSignedObjectUrl(OssReq req) {
|
||||
|
||||
Reference in New Issue
Block a user