server:
port: 8089
spring:
datasource:
# 配置德鲁伊数据库连接池
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/personalblog?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: root
type: com.alibaba.druid.pool.DruidDataSource
thymeleaf:
prefix: classpath:/templates/
suffix: .html
mode: html
cache: false
# 配置redis
redis:
host: 127.0.0.1
database: 0
port: 6379
cache:
redis:
time-to-live: 1800000 #缓存数据的过期时间
#开启mybatis的驼峰命名
mybatis-plus:
configuration:
map-underscore-to-camel-case: true
# 控制台输出日志
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# 雪花算法自动生成id
global-config:
db-config:
id-type: assign_id
logic-delete-field: flag # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2)
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
personalBlog:
path: E:\企业课项目\软件\Blog\src\main\resources\templates\static\images\upload\
avatar:
path: ../static/images/avatar/
Springboot+Mybatis整合基本代码
最新推荐文章于 2022-10-24 00:00:00 发布