IDEA旗舰版是可以直接创建SpringBoot工程的。

github源码地址

  • File -New-Project。
    SpringBoot+MyBatis配置
  • 包名、工程名这些都不用说了。
    SpringBoot+MyBatis配置
  • 这里选择上Web,
    SpringBoot+MyBatis配置
  • 选用mybatis。其他可以根据自己的需要去选择。
    SpringBoot+MyBatis配置
  • 一路next就基本OK了。
  • 工程结构,配置文件我使用的.yaml文件。如下
    SpringBoot+MyBatis配置
  • pom.xml
    SpringBoot+MyBatis配置
  • 注解扫描mapper所在位置
    SpringBoot+MyBatis配置
  • mapper中实现数据的增删改查
    SpringBoot+MyBatis配置
  • Controller中控制页面访问
    SpringBoot+MyBatis配置
  • 在Service里处理逻辑代码
    SpringBoot+MyBatis配置

好吧,基本就是这个结构和注解的使用。

相关文章: