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();
}
/**
* 删除
*/

View File

@@ -19,6 +19,6 @@ import java.util.List;
public interface BuyOrderDao extends BaseMapper<BuyOrder> {
List<BuyOrder> orderList(BuyOrderListRequestVo requestVo);
Page<BuyOrder> testPage(Page<BuyOrder> page);
// Page<BuyOrder> testPage(Page<BuyOrder> page);
}

View File

@@ -14,6 +14,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface MyUserDao extends BaseMapper<MyUserEntity> {
void update(MyUserEntity user);
}

View File

@@ -42,7 +42,6 @@ public interface MyUserService extends IService<MyUserEntity> {
//电子书购买
String buyEbook(String userId, String bookId,String couponId);
void update (MyUserEntity user);
//第三方微信登录
R getUserInfoByApp(UserAppAuthorEntity userAppAuthorEntity);

View File

@@ -352,16 +352,6 @@ public class MyUserServiceImpl extends ServiceImpl<MyUserDao, MyUserEntity> impl
return "购买成功!";
}
/**
* 更新
*
* @param user
*/
@Override
public void update(MyUserEntity user) {
myUserDao.update(user);
}
/**
* 微信授权登录