Commit 31bd9383 by 刘栋

细化配置

parent 0e2e9b05
package com.infynova.udi.controller;
import com.infynova.udi.entity.SysFile;
import com.infynova.udi.manager.storage.platform.LocalFileStorage;
import com.infynova.udi.manager.storage.service.SysFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
@Slf4j
@RestController
@RequestMapping("oss")
@Api(tags = "图片上传")
public class OSSController {
@Autowired
private SysFileService sysFileService;
@Autowired
private LocalFileStorage localFileStorage;
@ApiOperation(value = "下载文件")
@GetMapping(value = "downloadFile")
@SneakyThrows
public void downloadFile(@RequestParam("fileId") Long fileId, HttpServletResponse response) {
SysFile sysFile = sysFileService.getById(fileId);
localFileStorage.download(sysFile.getId(),response);
}
}
......@@ -63,7 +63,7 @@ public class FileStorageProperties {
/**
* 存储空间
*/
private String bucketName = "";
private String bucketName = "udi/";
/**
* 上传地址
*/
......
......@@ -10,10 +10,13 @@ spring:
# main:
# allow-bean-definition-overriding: true
datasource:
url: jdbc:mysql://rm-wz92456b388ahxujbuo.mysql.rds.aliyuncs.com:3306/saas_base_test?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
url: jdbc:mysql://127.0.0.1:3306/saas_udi?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
username: root
password: Xhe6aiNgi8ehaZgh
#url: jdbc:mysql://rm-wz92456b388ahxujbuo.mysql.rds.aliyuncs.com:3306/saas_base_test?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
#url: jdbc:p6spy:mysql://rm-wz92456b388ahxujbuo.mysql.rds.aliyuncs.com:3306/saas_base_test?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
username: saas_test
password: qjCEgXg2z9U5mjL7
#username: saas_test
#password: qjCEgXg2z9U5mjL7
driver-class-name: com.mysql.cj.jdbc.Driver
#driver-class-name: com.p6spy.engine.spy.P6SpyDriver
type: com.zaxxer.hikari.HikariDataSource
......@@ -27,7 +30,8 @@ spring:
# Redis 配置(Spring Boot 2.x 格式)
redis:
#host: 172.18.91.89
host: 39.108.112.41
#host: 39.108.112.41
host: 127.0.0.1
port: 6379
password: O5VefwieTul9h0uw
lettuce:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment