Commit a98e8975 authored by 刘基明's avatar 刘基明

热点数据

parent ec67d05e
......@@ -297,9 +297,10 @@ public class ThemeManager {
//点赞,收藏,转发
Integer likeCount = collectionService.getCountByTypeAndId(themeId, CollectionTypeEnum.LIKE_THEME);
Integer bookCount = collectionService.getCountByTypeAndId(themeId, CollectionTypeEnum.COLLECT_THEME);
// Integer bookCount = collectionService.getCountByTypeAndId(themeId, CollectionTypeEnum.COLLECT_THEME);
Integer commentCount = commentService.getCommentCountByThemeId(themeId);
Integer forwardCount = themeService.getForwardCountById(themeId);
themeQo.setCommentCount(bookCount);
themeQo.setCommentCount(commentCount);
themeQo.setLikeCount(likeCount);
themeQo.setForwardCount(forwardCount);
}
......
......@@ -49,6 +49,13 @@ public class CommentService {
.size();
}
//统计主题集合的评论量
public Integer getCommentCountByThemeId(String themeId) {
return commentMapper.selectList((new LambdaQueryWrapper<CommentEntity>()
.eq(CommentEntity::getThemeId, themeId)))
.size();
}
public Set<String> getCommentUserCount(List<String> themeIds) {
return commentMapper.selectList((new LambdaQueryWrapper<CommentEntity>()
.in(CommentEntity::getThemeId, themeIds)))
......
......@@ -172,7 +172,7 @@ public class ThemeService {
public Integer getForwardCountById(String themeId) {
return themeMapper.selectCount(new LambdaQueryWrapper<ThemeEntity>()
.eq(ThemeEntity::getThemeId, themeId)
.eq(ThemeEntity::getFormerThemeId, themeId)
.eq(ThemeEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment