mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-14 06:03:42 +08:00
fix:优化
This commit is contained in:
@@ -104,21 +104,6 @@
|
||||
<groupId>org.redisson</groupId>
|
||||
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!-- Used for unit testing -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>${junit.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>5.3.19</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.rocketmq</groupId>
|
||||
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
||||
|
||||
@@ -40,6 +40,11 @@
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<mainClass>none</mainClass> <!-- 取消查找本项目下的Main方法:为了解决Unable to find main class的问题 -->
|
||||
<classifier>execute
|
||||
</classifier> <!-- 解决maven-plugin插件打的Jar包可以运行,但依赖方打包找不到此模块中的类或属性的问题(程序包xxx不存在) -->
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@@ -21,4 +21,22 @@
|
||||
<artifactId>minio</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<mainClass>none</mainClass> <!-- 取消查找本项目下的Main方法:为了解决Unable to find main class的问题 -->
|
||||
<classifier>execute
|
||||
</classifier> <!-- 解决maven-plugin插件打的Jar包可以运行,但依赖方打包找不到此模块中的类或属性的问题(程序包xxx不存在) -->
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -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