创建maven的web项目,得到基本项目架构。

先贴出最后成果图maven实现springboot-mybatis框架(1)


1、创建入口类:

SpringBootApplication注解是EnableAutoConfiguration、ComponentScan和Configuration三个注解的合计。

EnableAutoConfiguration :让SpringBoot根据所声明的依赖对spring框架进行自动配置

ComponentScan:扫描所有组件(@Controller @Service @Repository @Component @Mapper)

Configuration:指出该类是Bean配置的信息源

maven实现springboot-mybatis框架(1)

2、编写controller层、service层、mapper层、pojo层

maven实现springboot-mybatis框架(1)

maven实现springboot-mybatis框架(1)

maven实现springboot-mybatis框架(1)

maven实现springboot-mybatis框架(1)






相关文章:

  • 2021-08-29
  • 2021-04-16
  • 2021-05-29
  • 2022-12-23
  • 2021-07-19
  • 2021-11-15
  • 2021-07-31
猜你喜欢
  • 2021-12-04
  • 2022-01-05
  • 2021-05-02
  • 2021-12-31
  • 2021-10-27
  • 2021-08-11
相关资源
相似解决方案