一个最小Spring应用
- https://spring.io/guides/gs/spring-boot/
- start:pom.xml + Application + HelloController
在Spring容器中引入Bean
1. Controller - Service - Dao 三层架构
- 为了业务逻辑的清晰
- controller只负责http请求相关(参数校验、返回封装)
- service负责逻辑,业务代码在这层
- Dao层只负责数据库
Spring周边 - 数据库
- Spring + MyBatis(H2、MySQL、Postgres)