搭建springboot框架建立项目流程(后端开发)
1.构建项目
2.准备数据库表
3.配置文件application.properties中引入mybatis的配置信息,准备对应的实体类
#驱动类名称
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#数据库连接的url
spring.datasource.url=jdbc:mysql://localhost:3306/数据库
#连接数据库的用户名
spring.datasource.username=用户
#连接数据库的密码
spring.datasource.password=密码
#配置mybatis的日志, 指定输出到控制台
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
#开启mybatis的驼峰命名自动映射开关 a_column ------> aCloumn
mybatis.configuration.map-underscore-to-camel-case=true
4.准备对应的基础架构(Mapper,Service接口实现类,Controller)
注意:若没有.iml文件:
点击文件后点两下ctrl
输入
mvn idea:module