20231007
This commit is contained in:
@@ -138,6 +138,56 @@ public class BookForumArticlesServiceController {
|
|||||||
return R.ok().put("page",bookEntityPage);
|
return R.ok().put("page",bookEntityPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 书集----已购图书
|
||||||
|
* @param userId
|
||||||
|
* @param limit
|
||||||
|
* @param page
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getHasForumsAndBook")
|
||||||
|
public R getHasForumsAndBook(@RequestParam Integer userId,@RequestParam Integer limit,@RequestParam Integer page){
|
||||||
|
String ex_sql = "select 1 from user_ebook_buy where book.id = book_id and user_id = "+userId;
|
||||||
|
String existSql = "select 1 from book_forum_articles where book.id = bookid";
|
||||||
|
|
||||||
|
LambdaQueryWrapper<BookEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(BookEntity::getDelFlag,0);
|
||||||
|
wrapper.exists(ex_sql);
|
||||||
|
wrapper.exists(existSql);
|
||||||
|
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
|
||||||
|
for (BookEntity b : bookEntityPage.getRecords()){
|
||||||
|
b.setForums(bookForumArticlesService.getForumsLimit(b.getId(), 4));
|
||||||
|
b.setForumNum(bookForumArticlesService.getForumsCount(b.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok().put("page",bookEntityPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 书集----推荐图书
|
||||||
|
* @param userId
|
||||||
|
* @param limit
|
||||||
|
* @param page
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getBestForumsAndBook")
|
||||||
|
public R getBestForumsAndBook(@RequestParam Integer userId,@RequestParam Integer limit,@RequestParam Integer page){
|
||||||
|
String ex_sql = "select 1 from user_ebook_buy where book.id = book_id and user_id = "+userId;
|
||||||
|
String existSql = "select 1 from book_forum_articles where book.id = bookid";
|
||||||
|
|
||||||
|
LambdaQueryWrapper<BookEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(BookEntity::getDelFlag,0);
|
||||||
|
wrapper.notExists(ex_sql);
|
||||||
|
wrapper.exists(existSql);
|
||||||
|
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
|
||||||
|
for (BookEntity b : bookEntityPage.getRecords()){
|
||||||
|
b.setForums(bookForumArticlesService.getForumsLimit(b.getId(), 4));
|
||||||
|
b.setForumNum(bookForumArticlesService.getForumsCount(b.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok().put("page",bookEntityPage);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 点赞书评帖子
|
* 点赞书评帖子
|
||||||
* @param forum_id
|
* @param forum_id
|
||||||
|
|||||||
Reference in New Issue
Block a user