1、application-database.yml
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: root
url: jdbc:mysql://localhost:3306/demo?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
type: com.alibaba.druid.pool.DruidDataSource
initialSize: 5
minIdle: 5
maxActive: 20
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
filters: stat,wall,log4j
maxPoolPreparedStatementPerConnectionSize: 20
useGlobalDataSourceStat: true
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
2、application-mybatis-plus.yml
mybatis-plus:
mapper-locations: classpath:mappers/*.xml
type-aliases-package: com.demo.entity
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
map-underscore-to-camel-case: true
3、application-pagehelper.yml
pagehelper:
helper-dialect: mysql
reasonable: true
support-methods-arguments: true
params: count=countSql
4、application-redis.yml
spring:
redis:
database: 0
host: localhost
port: 6379
password:
timeout: 1000
lettuce:
pool:
max-active: 8
max-wait: -1ms
max-idle: 5
min-idle: 0
shutdown-timeout: 100
5、合并 yml
server:
port: 8001
spring:
application:
name: your project name
profiles:
include: database, mybatis-plus