项目目录:
数据库表以及表结构
user表结构
user_info表结构
引入依赖
父模块依赖:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.12.RELEASE</version>
</parent>
<properties>中的版本管理
<!--mybatis版本-->
<mybatis.spring.version>2.2.2</mybatis.spring.version>
<!--Druid版本-->
<druid.version>1.2.11</druid.version>
<!--mysql版本-->
<mysql.version>5.1.38</mysql.version>
<dependences>依赖:
<!--应用程序的web起步依赖,包含了构建web应用程序所需的基本组件和依赖-->
<!--使用该依赖可以快速启动一个基于SpringMVC的应用程序-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--添加测试依赖,该依赖用于在SpringBoot应用程序中进行单元测试和继承测试-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis.spring.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
添加配置文件
application.xml
spring:
profiles:
active: dev
server:
port: 8088
servlet: