三:crud
1:完成其余功能的crud,并在接口文档中进行测试。接口文档采用apifox
代码:https://gitee.com/SuperFishingKingdom/badminton
2:在接口文档中测试功能
3:修改出错功能,完善代码,完善校验操作
4:为BookingInfo表添加乐观锁,同时在表中新增version字段。
@Column(version = true)
private Integer version;
乐观锁:MyBatis-Flex 乐观锁 - MyBatis-Flex 官方网站
5:增加token与token的拦截器
Map<String,Object> payLoad=new HashMap<String,Object>(){
private static final long serialVersionUID = 1L;{
put("adminId",admin1.getAdminId());
put("adminName",admin1.getAdminName());
put("adminPassword",admin1.getAdminPassword());
put("adminState",admin1.getAdminState());
put("roles","admin");
}
};
String token= JWTUtil.createToken(payLoad,"123".getBytes());
为密码设置加密操作
Argon2 argon2 = Argon2Factory.create(Argon2Factory.Argon2Types.ARGON2id);//Argon2加密
int memory = 65536; // 内存使用量,单位是KB
int parallelism = 2; // 并行度
int iterations = 3; // 迭代次数
String hash=argon2.hash(iterations,memory,parallelism,adminDto.getAdminPassword().toCharArray());
admin.setAdminPassword(hash);
6:考虑新增dto和vo类