2020-08-20
計劃:看完一半視頻
筆記:
- starter的用法:spring-boot-starter-xxxxx
- 啟動類和basepackage掃描包的位置
@springbootapplication配置類 - 熱部署雕擂、liveReload
spring-boot-devtools - yaml配置文件
- @Data注解于樟,lombok配置文件
2020-08-21
- @component 加入ioc容器中(之后橄霉,@autowired注入)雕憔,但如果是構(gòu)造器月弛,在類中標注@configurationproperties(“xxx.xxx.xxx”)(配置文件)幻林,controller中要用@enableconfigurationproperties(開啟這個類)
- @validated 屬性校驗 引入別的類输虱,要加@valid
- @value("${xxx.xxx.xxx}") 對單個屬性生效摘能,進行綁定
- 注解啥的都用羊肉串模式吧
- java spi機制
2020-08-24
上周看springboor源碼沒看懂站刑。今天好好看另伍。
1、@enableconfigurationproperties("xxxxx")
可以不加@autowired的注入,就要用構(gòu)造器注入properties摆尝。
2温艇、數(shù)據(jù)源自動配置、jdbctemplate堕汞、mybatis自動配置
spring-boot-starter-jdbc
我覺得我老了勺爱,唉
學不動了