Merge branch 'master' into develop/express

This commit is contained in:
Cauchy
2023-10-25 09:05:37 +08:00
9 changed files with 39 additions and 38 deletions

View File

@@ -228,6 +228,7 @@ public class BookForumArticlesServiceController {
public R getForumByBook(@RequestParam Integer bookId,@RequestParam Integer limit,@RequestParam Integer page){
LambdaQueryWrapper<BookForumArticlesEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BookForumArticlesEntity::getDelflag,0);
wrapper.eq(BookForumArticlesEntity::getBookid,bookId);
wrapper.orderByDesc(BookForumArticlesEntity::getCreateTime);
Page<BookForumArticlesEntity> bookForumArticlesEntityPage = bookForumArticlesService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
for (BookForumArticlesEntity b:bookForumArticlesEntityPage.getRecords()){

View File

@@ -119,7 +119,6 @@ public class MyUserController {
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("book:user:save")
public R save(@RequestBody MyUserEntity user){
String password = user.getPassword();
String saltMD5 = MD5Utils.getSaltMD5(password);
@@ -130,24 +129,33 @@ public class MyUserController {
}
/**
* 修改
* 修改用户信息
*/
@RequestMapping("/update")
// @RequiresPermissions("book:user:update")
public R update(@RequestBody MyUserEntity user){
if (!StringUtils.isEmpty(user.getPassword())) {
String password = user.getPassword();
String saltMD5 = MD5Utils.getSaltMD5(password);
user.setPassword(saltMD5);
userService.updateById(user);
}else{
userService.update(user);
}
System.out.println(user.toString());
userService.updateById(user);
return R.ok();
}
/**
* 修改用户密码
* @param user
* @return
*/
@RequestMapping("/updateUserPassword")
public R updateUserPassword(@RequestBody MyUserEntity user){
String password = user.getPassword();
if(password.equals(null)){
return R.error("密码不能为空");
}
String saltMD5 = MD5Utils.getSaltMD5(password);
user.setPassword(saltMD5);
userService.updateById(user);
return R.ok();
}
/**
* 删除
*/