From da06d0fb7822c833b1e007e32a2b1f5649d83d9a Mon Sep 17 00:00:00 2001 From: smallchill Date: Mon, 27 May 2019 21:10:26 +0800 Subject: [PATCH] =?UTF-8?q?:tada:=20gateway=E5=8A=A8=E6=80=81=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E3=80=81oss=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gateway/props/RouteProperties.java | 2 ++ .../demo/controller/UploadController.java | 18 ------------------ .../src/main/resources/application.yml | 12 +++--------- doc/nacos/blade-dev.yaml | 8 ++++++++ 4 files changed, 13 insertions(+), 27 deletions(-) diff --git a/blade-gateway/src/main/java/org/springblade/gateway/props/RouteProperties.java b/blade-gateway/src/main/java/org/springblade/gateway/props/RouteProperties.java index 215b755fb..fd039e5c2 100644 --- a/blade-gateway/src/main/java/org/springblade/gateway/props/RouteProperties.java +++ b/blade-gateway/src/main/java/org/springblade/gateway/props/RouteProperties.java @@ -18,6 +18,7 @@ package org.springblade.gateway.props; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.cloud.context.config.annotation.RefreshScope; import java.util.ArrayList; import java.util.List; @@ -28,6 +29,7 @@ import java.util.List; * @author Chill */ @Data +@RefreshScope @ConfigurationProperties("blade.document") public class RouteProperties { diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/controller/UploadController.java b/blade-service/blade-demo/src/main/java/com/example/demo/controller/UploadController.java index 674528d0a..6d785a522 100644 --- a/blade-service/blade-demo/src/main/java/com/example/demo/controller/UploadController.java +++ b/blade-service/blade-demo/src/main/java/com/example/demo/controller/UploadController.java @@ -4,7 +4,6 @@ import io.swagger.annotations.Api; import lombok.AllArgsConstructor; import lombok.SneakyThrows; import org.springblade.core.minio.MinioTemplate; -import org.springblade.core.qiniu.QiniuTemplate; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -27,8 +26,6 @@ public class UploadController { private MinioTemplate minioTemplate; - private QiniuTemplate qiniuTemplate; - /** * minio上传demo * @@ -43,19 +40,4 @@ public class UploadController { return R.data(link); } - /** - * qiniu上传demo - * - * @param file 上传文件 - * @param fileKey 上传文件key - * @return String - */ - @SneakyThrows - @PostMapping("put-qiniu-object") - public R putQiniuObject(@RequestParam MultipartFile file, @RequestParam String fileKey) { - qiniuTemplate.putFile(fileKey,file); - String link = qiniuTemplate.fileLink(fileKey); - return R.data(link); - } - } diff --git a/blade-service/blade-demo/src/main/resources/application.yml b/blade-service/blade-demo/src/main/resources/application.yml index 4fc32d15c..38326ec6f 100644 --- a/blade-service/blade-demo/src/main/resources/application.yml +++ b/blade-service/blade-demo/src/main/resources/application.yml @@ -10,18 +10,12 @@ swagger: - org.springbalde - com.example -minio: +#oss配置 +oss: enable: true + name: minio tenant-mode: false endpoint: http://127.0.0.1:9000 access-key: D99KGE6ZTQXSATTJWU24 secret-key: QyVqGnhIQQE734UYSUFlGOZViE6+ZlDEfUG3NjhJ bucket-name: bladex - -qiniu: - enable: true - tenant-mode: false - endpoint: prv0t4ij6.bkt.clouddn.com - access-key: N_Loh1ngBqcJovwiAJqR91Ifj2vgOWHOf8AwBA_h - secret-key: AuzuA1KHAbkIndCU0dB3Zfii2O3crHNODDmpxHRS - bucket-name: bladex diff --git a/doc/nacos/blade-dev.yaml b/doc/nacos/blade-dev.yaml index 42aa86168..fb6261815 100644 --- a/doc/nacos/blade-dev.yaml +++ b/doc/nacos/blade-dev.yaml @@ -20,3 +20,11 @@ blade: url: jdbc:mysql://localhost:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8 username: root password: root + document: + resources: + - name: 授权模块 + location: /blade-auth + - name: 工作台模块 + location: /blade-desk + - name: 系统模块 + location: /blade-system