优化配置文件

This commit is contained in:
chenxudong 2025-02-11 15:32:55 +08:00
parent 409afa710b
commit bac3da7d8f
3 changed files with 28 additions and 16 deletions

View File

@ -1,10 +1,10 @@
package com.electromagnetic.industry.software.backup.pojo;
import lombok.Data;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Data
@Setter
@Component
@ConfigurationProperties(prefix = "ele.backup")
public class BackupPro {
@ -13,4 +13,13 @@ public class BackupPro {
private String logPath;
private String winPrefix;
public String getSaveFolder() {
return System.getProperty("os.name").toLowerCase().startsWith("win") ? winPrefix + saveFolder : saveFolder;
}
public String getLogPath() {
return System.getProperty("os.name").toLowerCase().startsWith("win") ? winPrefix + logPath : logPath;
}
}

View File

@ -1,8 +1,9 @@
ele:
backup:
saveFolder: "E:/szsd/ele/data/backup/"
logPath: "E:/szsd/ele/data/backup.log"
saveFolder: "/szsd/ele/data/backup/"
logPath: "/szsd/ele/data/backup.log"
winPrefix: "D:/tmp"
spring:
servlet:

View File

@ -1,25 +1,27 @@
#required
spring.application.name=electromagnetic-data
spring.datasource.typd=com.alibaba.druid.pool.DruidDataSource
spring.datasource.url=jdbc:mysql://139.224.43.89:3306/em_data?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true&rewriteBatchedStatements=true
spring.datasource.username=comac
spring.datasource.password=2024*Comac
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/em_data_dev?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true&rewriteBatchedStatements=true
spring.datasource.username=user
spring.datasource.password=123123
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
mybatis-plus.mapper-locations=classpath:sqlmapper/*.xml
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
spring.servlet.multipart.max-file-size=500MB
spring.servlet.multipart.max-request-size=10MB
spring.servlet.multipart.max-request-size=500MB
pagehelper.helperDialect=mysql
pagehelper.reasonable=false
server.port=12395
file.security.passwd=adknfhkj87654knd
server.port=12396
#windows文件存储目录用于测试
data.windows.path=D:/tmp/eleData/project/
data.linux.path=/szsd/data/eleData/project/
data.upload.windows.tmp.path=D:/tmp/eleData/upload/
data.upload.linux.tmp.path=/szsd/data/eleData/upload/
data.download.windows.tmp.path=D:/tmp/eleData/download/
data.download.linux.tmp.path=/szsd/data/eleData/download/
data.windows.path=D:/tmp/szsd/data/eleData/dev/project/
data.upload.windows.tmp.path=D:/tmp/szsd/data/eleData/dev/upload/
data.download.windows.tmp.path=D:/tmp/szsd/data/eleData/dev/download/
data.linux.path=/szsd/data/eleData/dev/project/
data.upload.linux.tmp.path=/szsd/data/eleData/dev/upload/
data.download.linux.tmp.path=/szsd/data/eleData/dev/download/
prj.folder.max.length=6
spring.jackson.time-zone=GMT+8