Files
UniversalTestSoftware/client/libs/classes/application-dev.yml

81 lines
3.5 KiB
YAML
Raw Normal View History

server:
port: 8081
servlet:
context-path: /universaltestsoftware_client_api
encoding:
force: true
charset: UTF-8
enabled: true
tomcat:
uri-encoding: UTF-8
logging:
level:
web: trace
#数据源连接信息
spring:
servlet:
multipart:
enabled: true
max-file-size: 300MB
max-request-size: 2048MB
datasource:
url: jdbc:mysql://192.168.100.40:3306/universaltestsoftware_client_api?characterEncoding=utf-8
username: root
password: Fushoukeji1234
driver-class-name: com.mysql.cj.jdbc.Driver
hikari:
keepalive-time: 180000
minimum-idle: 5
maximum-pool-size: 20
connection-timeout: 30000
idle-timeout: 600000
max-lifetime: 1800000
druid:
keep-alive: true
initial-size: 5 # 初始化连接大小
min-idle: 5 # 最小连接池数量
max-active: 20 # 最大连接池数量
max-wait: 30000 # 获取连接时最大等待时间,单位毫秒
time-between-eviction-runs-millis: 30000 # 配置间隔多久检测一次空闲连接,单位毫秒
min-evictable-idle-time-millis: 30000 # 连接在池中最小生存时间,单位毫秒
validation-query: SELECT 1 # 测试连接的SQL语句
test-while-idle: true # 申请连接时检测,建议开启
test-on-borrow: false # 获取连接时执行检测,建议关闭
test-on-return: false # 归还连接时执行检测,建议关闭
pool-prepared-statements: false # 是否开启PSCachemysql建议关闭
max-pool-prepared-statement-per-connection-size: 20 # 开启PSCache后生效
filters: stat,wall # 配置扩展插件
connection-properties: 'druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000' # 打开mergeSql功能和慢SQL记录
#新增Wall过滤器配置解决Flyway创建表被拦截的问题 解决SQL注入拦截问题的核心配置
filter:
wall:
enabled: true
config:
# 允许非基础语句如DDL
noneBaseStatementAllow: true
# 允许SQL中包含注释
commentAllow: true
# 针对MySQL的特定配置
mysql:
allowMultiQueries: true
flyway:
#是否启用
enabled: true
# 可以支持多个location, 用','隔开
locations: classpath:db/migration
#是否创建元数据表
validate-on-migrate: true
# flyway 的 clean 命令会删除指定 schema 下的所有 table, 生产务必禁掉。这个默认值是
clean-disabled: false
# 如果数据库不是空表,需要设置成 true否则启动报错
baseline-on-migrate: true
# 版本控制日志表默认flyway_schema_history,不同系统建议修改数据
# table: flyway_schema_history
cbsd:
uploadfilesrootpath: "C:/Java"
scriptBasePackageName: "com.cbsd.client"
scriptRootPath: C:\script
commandRootPath: C:\command