2020-08-20
计划:看完一半视频
笔记:
- starter的用法:spring-boot-starter-xxxxx
- 启动类和basepackage扫描包的位置
@springbootapplication配置类 - 热部署、liveReload
spring-boot-devtools - yaml配置文件
- @Data注解,lombok配置文件
2020-08-21
- @component 加入ioc容器中(之后,@autowired注入),但如果是构造器,在类中标注@configurationproperties(“xxx.xxx.xxx”)(配置文件),controller中要用@enableconfigurationproperties(开启这个类)
- @validated 属性校验 引入别的类,要加@valid
- @value("${xxx.xxx.xxx}") 对单个属性生效,进行绑定
- 注解啥的都用羊肉串模式吧
- java spi机制
2020-08-24
上周看springboor源码没看懂。今天好好看。
1、@enableconfigurationproperties("xxxxx")
可以不加@autowired的注入,就要用构造器注入properties。
2、数据源自动配置、jdbctemplate、mybatis自动配置
spring-boot-starter-jdbc
我觉得我老了,唉
学不动了
网友评论