1. 初始化SpringBoot
1.1 创建SpringBoot项目
清理spring-boot-starter-test,有需要的可以留着
1.2 application.properties
将application.properties改为yaml,个人习惯问题,顺便设置端口8888,和前端设置的一样
server:
port: 8888
spring:
application:
name: springboot-api
2. 鉴权体系及数据库连接
鉴权体系使用 JWT + security
数据库连接使用 MySQL + mybatis-plus
相比 Spring Boot 2.x , Spring Boot 3.x 中,很多方法进行了调整,所以很多写法和2.x中是不一样的,如:
- Spring Boot 3.x 中,WebSecurityConfigurerAdapter 已经被弃用ÿ