Vue +Springboot + MySQL制作搜索引擎(三)后端用 spring boot 连接数据库和前端接口设计
后端我用 IntelliJ IDEA 软件。
一. 创建项目
file-new-project
next
next
选择web-spring web,next
后面就是选择文件存储位置,这个按照个人喜好即可。最后finish
二. 项目设计
1.配置 POM 池
因为要连接数据库,所以要引入数据库的dependency。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<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-web-services</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 这个需要为 true 热部署才有效 -->
</dependency>
<