项目配置yaml
2024-09-05 23:00:54
springboot的一些配置
#当循环调用时,就会报错
spring.main.allow-circular-references=true
#配置mvc是需要使用一个@EnableWebMvc,不使用添加下面的配置即可
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
#开启驼峰命名
mybatis-plus.configuration.map-underscore-to-camel-case=true
#mybatis-plus 开启与关闭 SQL 日志打印,后面是前缀
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus.global-config.db-config.table-prefix=ms_
spring:
datasource:
username: root
password: admin
#?serverTimezone=UTC解决时区的报错
url: jdbc:mysql://localhost:3306/mybatis?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
#Spring Boot 默认是不注入这些属性值的,需要自己绑定
#druid 数据源专有配置
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:监控统计、log4j:日志记录、wall:防御sql注入
#如果允许时报错 java.lang.ClassNotFoundException: org.apache.log4j.Priority
#则导入 log4j 依赖即可,Maven 地址:https://mvnrepository.com/artifact/log4j/log4j
filters: stat,wall,log4j
maxPoolPreparedStatementPerConnectionSize: 20
useGlobalDataSourceStat: true
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
mybatis:
type-aliases-package: nuc.ss.pojo
mapper-locations: classpath:mapper/*.xml
最新文章
- 安装Windows更新程序遇到错误:0x80070422
- 结婚虽易,终老不易:EntityFramework和AutoMapper的婚后生活
- 【001:go语言的一些语法基础】
- jQuery概述
- JAVA的单例模式与延时加载
- Sphinx的配置和使用
- 使用BroadcastReceiver实现开机自动运行的Service
- ios入门之c语言篇——基本函数——3——判断日期是一年的第几天
- UIViewController的生命周期及iOS程序执行顺序
- 兼容不同浏览器的 CSS Hack 写法
- 【翻译】在Visual Studio中使用Asp.Net Core MVC创建第一个Web Api应用(二)
- Update关联查询不走索引,效率低下
- sc.exe用法详解
- 《Java程序设计》 第一周学习总结
- 一次完整的HTTP事务是怎样一个过程?(转)
- windows特殊文件或文件夹
- 【SP1811】LCS - Longest Common Substring
- 2017-2018-2 1723 『Java程序设计』课程 结对编程练习-四则运算-最后阶段
- 【View】之【SimplePillarsView】可多色可圆角柱状图【demo】
- 字典树---2001 POJ Shortest Prefixes(找最短前缀)