Springboot+Mybatis整合基本代码

Springboot+Mybatis整合基本代码
更新时间:2022-09-23 11:39:26发布时间:3小时前朗读
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:企业课项目软件Blogsrcmainresourcestemplatesstaticimagesupload
avatar:
path: …/static/images/avatar/

文章转自:Springboot+Mybatis整合基本代码_Java-答学网

作者:答学网,转载请注明原文链接:http://www.dxzl8.com/

猜你喜欢

转载自blog.csdn.net/zl5186888/article/details/127007839