|
@@ -533,6 +533,21 @@ public class BookServiceImpl implements BookService {
|
|
|
return userRecentlyReadMapper.selectByExample(example);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<Long> getUserConsumerChapter(BookContentVO bookContentVO) {
|
|
|
+ List<Consume> consumes = consumeMapper.selectByExampleSelective(ConsumeExample.newAndCreateCriteria()
|
|
|
+ .andUserIdEqualTo(bookContentVO.getUserId())
|
|
|
+ .andBookIdEqualTo(bookContentVO.getBookId())
|
|
|
+ .example(),
|
|
|
+ Consume.Column.chapterId
|
|
|
+ );
|
|
|
+ List<Long> collect = new ArrayList<>();
|
|
|
+ if (consumes != null) {
|
|
|
+ collect = consumes.stream().map(Consume::getChapterId).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ return collect;
|
|
|
+ }
|
|
|
+
|
|
|
private List<BookRes> getRandom(List<BookRes> bookRes) {
|
|
|
if (bookRes.size() <= 4) {
|
|
|
return bookRes;
|