Browse Source

🎉 gateway动态文档、oss优化

test
smallchill 6 years ago
parent
commit
da06d0fb78
  1. 2
      blade-gateway/src/main/java/org/springblade/gateway/props/RouteProperties.java
  2. 18
      blade-service/blade-demo/src/main/java/com/example/demo/controller/UploadController.java
  3. 12
      blade-service/blade-demo/src/main/resources/application.yml
  4. 8
      doc/nacos/blade-dev.yaml

2
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 {

18
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<String> putQiniuObject(@RequestParam MultipartFile file, @RequestParam String fileKey) {
qiniuTemplate.putFile(fileKey,file);
String link = qiniuTemplate.fileLink(fileKey);
return R.data(link);
}
}

12
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

8
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

Loading…
Cancel
Save