目录
1. 开发环境搭建
1.1 导入数据库表
1.2 maven项目搭建
2. 后台登录
2.1 准备工作
1.设置静态资源映射
2. 创建表结构
3. 创建返回结果处理类R.java
2.2 编写业务代码
1. 员工登录
2. 员工退出
1. 开发环境搭建
1.1 导入数据库表
1.2 maven项目搭建
搭建完后要注意检查项目配置:
1. 检查maven仓库配置和jdk配置
2. 添加依赖
在pom.xml文件中添加相关依赖。
3. 编写配置文件
application.yml
mysql:
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