目录
1. 开发环境搭建
1.1 导入数据库表
1.2 maven项目搭建
搭建完后要注意检查项目配置:
1. 检查maven仓库配置和jdk配置
2. 添加依赖
在pom.xml文件中添加相关依赖。
3. 编写配置文件
application.yml
mysql://localhost:3306/reggie?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: root
mybatis-plus:
configuration:
#在映射实体或者属性时,将数据库中表名和字段名中的下划线去掉,按照驼峰命名法映射
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
id-type: ASSIGN_ID
4. 编写启动类
@Slf4j
@SpringBootApplication
public class ReggieApplication {
public static void main(String[] args) {
SpringApplication.run(ReggieApplication.class,args);
log.info("项目启动成功...");
}
}
2. 后台登录
2.1 准备工作
1.设置静态资源映射
创建配置类WebMvcConfig.java
/**
* 设置静态资源映射
* @param registry