常用配置

MySQL配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/xxx?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
username: username
password: password
hikari:
connection-timeout: 10000
validation-timeout: 3000
idle-timeout: 60000
login-timeout: 5
max-lifetime: 60000
maximum-pool-size: 10
minimum-idle: 5
read-only: false

Redis配置

1
2
3
4
5
6
7
8
9
10
11
spring:
redis:
host: r-2zec1xnklp1y8ipk4vpd.redis.rds.aliyuncs.com
password: Root9275
port: 6379
lettuce:
pool:
max-active: 8 #最大连接
max-idle: 8 #最大空闲连接
min-idle: 0 #最小空闲连接
max-wait: 100ms #连接等待时间

Mail配置

1
2
3
4
5
6
7
8
spring:
mail:
# 不同的邮箱是不同的邮箱服务器域名
# qq是smtp.qq.com
host: smtp.163.com
protocol: smtp
username: 邮箱
password: 密钥

MyBatis-Plus配置

1
2
3
4
5
6
7
8
mybatis-plus:
mapper-locations: classpath:com/wisdom/mapper/*/*.xml
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
default-enum-type-handler: org.apache.ibatis.type.EnumOrdinalTypeHandler
type-aliases-package: com.zhima.entity
type-enums-package: com.zhima.enums