添加用户购买的书籍

This commit is contained in:
wuchunlei
2023-12-04 16:51:45 +08:00
parent 2a7e178fde
commit 9ca2d6bc31

View File

@@ -114,6 +114,31 @@ public class BookTeachLikeAndCommentController {
} }
return R.ok().put("page", page); return R.ok().put("page", page);
} }
/**
* 获取全部评论列表
*/
@RequestMapping("/getAllCommentList")
public R getAllCommentList(@RequestBody Map<String, Object> params) {
MPJLambdaWrapper<BookTeachCommentEntity> wrapper = new MPJLambdaWrapper<>();
wrapper.eq(BookTeachCommentEntity::getDelFlag,0);
IPage<BookTeachCommentEntity> page = commentService.page(
new Query<BookTeachCommentEntity>().getPage(params),wrapper);
return R.ok().put("page", page);
}
/**
* 根据内容查询评论
*/
@RequestMapping("/getCommentByContent")
public R getCommentByContent(@RequestBody Map<String, Object> params) {
MPJLambdaWrapper<BookTeachCommentEntity> wrapper = new MPJLambdaWrapper<>();
wrapper.like(BookTeachCommentEntity::getContent,params.get("content"));
IPage<BookTeachCommentEntity> page = commentService.page(
new Query<BookTeachCommentEntity>().getPage(params),wrapper);
return R.ok().put("page", page);
}
//递归查询子评论 //递归查询子评论
private void getSonComment(BookTeachCommentEntity comment){ private void getSonComment(BookTeachCommentEntity comment){
LambdaQueryWrapper<BookTeachCommentEntity> w = new LambdaQueryWrapper(); LambdaQueryWrapper<BookTeachCommentEntity> w = new LambdaQueryWrapper();