- 增加:qiniu 文件服务

This commit is contained in:
cherishsince 2020-05-02 08:38:05 +08:00
parent 157b166435
commit 83d9afd3d0
4 changed files with 34 additions and 6 deletions

View File

@ -5,3 +5,9 @@ spring:
# Profile 的配置项 # Profile 的配置项
profiles: profiles:
active: local active: local
# TODO 小范 TO 芋艿,这个临时加了个
qiniu:
bucket: xx
access-key: xx
secret-key: xx

View File

@ -60,6 +60,12 @@
<artifactId>aliyun-java-sdk-core</artifactId> <artifactId>aliyun-java-sdk-core</artifactId>
</dependency> </dependency>
<!-- 文件服务商 -->
<dependency>
<groupId>com.qiniu</groupId>
<artifactId>qiniu-java-sdk</artifactId>
</dependency>
<!-- 工具类相关 --> <!-- 工具类相关 -->
<dependency> <dependency>
<groupId>org.mapstruct</groupId> <groupId>org.mapstruct</groupId>
@ -78,6 +84,7 @@
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -0,0 +1,21 @@
package cn.iocoder.mall.system.biz.config;
import com.qiniu.util.Auth;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class QiniuConfiguration {
@Value("${qiniu.access-key}")
private String accessKey;
@Value("${qiniu.secret-key}")
private String secretKey;
@Bean
public Auth auth() {
return Auth.create(accessKey, secretKey);
}
}

View File

@ -36,12 +36,6 @@
<artifactId>mall-spring-boot-starter-swagger</artifactId> <artifactId>mall-spring-boot-starter-swagger</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<!-- 文件服务商 -->
<dependency>
<groupId>com.qiniu</groupId>
<artifactId>qiniu-java-sdk</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>