From 83d9afd3d0a9e34a175bc49068f0a7b79628ee62 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Sat, 2 May 2020 08:38:05 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=A2=9E=E5=8A=A0=EF=BC=9Aqiniu=20?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yaml | 6 ++++++ system/system-biz/pom.xml | 7 +++++++ .../system/biz/config/QiniuConfiguration.java | 21 +++++++++++++++++++ system/system-rest/pom.xml | 6 ------ 4 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 system/system-biz/src/main/java/cn/iocoder/mall/system/biz/config/QiniuConfiguration.java diff --git a/system/system-application/src/main/resources/application.yaml b/system/system-application/src/main/resources/application.yaml index 0c9dbffc4..4300ab3c1 100644 --- a/system/system-application/src/main/resources/application.yaml +++ b/system/system-application/src/main/resources/application.yaml @@ -5,3 +5,9 @@ spring: # Profile 的配置项 profiles: active: local + +# TODO 小范 TO 芋艿,这个临时加了个 +qiniu: + bucket: xx + access-key: xx + secret-key: xx diff --git a/system/system-biz/pom.xml b/system/system-biz/pom.xml index 2ca1f83bf..2375b2c26 100644 --- a/system/system-biz/pom.xml +++ b/system/system-biz/pom.xml @@ -60,6 +60,12 @@ aliyun-java-sdk-core + + + com.qiniu + qiniu-java-sdk + + org.mapstruct @@ -78,6 +84,7 @@ com.alibaba fastjson + diff --git a/system/system-biz/src/main/java/cn/iocoder/mall/system/biz/config/QiniuConfiguration.java b/system/system-biz/src/main/java/cn/iocoder/mall/system/biz/config/QiniuConfiguration.java new file mode 100644 index 000000000..7e5519d00 --- /dev/null +++ b/system/system-biz/src/main/java/cn/iocoder/mall/system/biz/config/QiniuConfiguration.java @@ -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); + } + +} diff --git a/system/system-rest/pom.xml b/system/system-rest/pom.xml index 6df6e384c..9e232f904 100644 --- a/system/system-rest/pom.xml +++ b/system/system-rest/pom.xml @@ -36,12 +36,6 @@ mall-spring-boot-starter-swagger 1.0-SNAPSHOT - - - - com.qiniu - qiniu-java-sdk -