2020-08-20springboot学习日记

2020-08-20

计划:看完一半视频
笔记:

  1. starter的用法:spring-boot-starter-xxxxx
  2. 启动类和basepackage扫描包的位置
    @springbootapplication配置类
  3. 热部署、liveReload
    spring-boot-devtools
  4. yaml配置文件
  5. @Data注解,lombok配置文件

2020-08-21

  1. @component 加入ioc容器中(之后,@autowired注入),但如果是构造器,在类中标注@configurationproperties(“xxx.xxx.xxx”)(配置文件),controller中要用@enableconfigurationproperties(开启这个类)
  2. @validated 属性校验 引入别的类,要加@valid
  3. @value("${xxx.xxx.xxx}") 对单个属性生效,进行绑定
  4. 注解啥的都用羊肉串模式吧
  5. java spi机制

2020-08-24

上周看springboor源码没看懂。今天好好看。
1、@enableconfigurationproperties("xxxxx")
可以不加@autowired的注入,就要用构造器注入properties。
2、数据源自动配置、jdbctemplate、mybatis自动配置
spring-boot-starter-jdbc
我觉得我老了,唉
学不动了

你可能感兴趣的:(2020-08-20springboot学习日记)