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

热点数据

parent ec67d05e
...@@ -297,9 +297,10 @@ public class ThemeManager { ...@@ -297,9 +297,10 @@ public class ThemeManager {
//点赞,收藏,转发 //点赞,收藏,转发
Integer likeCount = collectionService.getCountByTypeAndId(themeId, CollectionTypeEnum.LIKE_THEME); 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); Integer forwardCount = themeService.getForwardCountById(themeId);
themeQo.setCommentCount(bookCount); themeQo.setCommentCount(commentCount);
themeQo.setLikeCount(likeCount); themeQo.setLikeCount(likeCount);
themeQo.setForwardCount(forwardCount); themeQo.setForwardCount(forwardCount);
} }
......
...@@ -49,6 +49,13 @@ public class CommentService { ...@@ -49,6 +49,13 @@ public class CommentService {
.size(); .size();
} }
//统计主题集合的评论量
public Integer getCommentCountByThemeId(String themeId) {
return commentMapper.selectList((new LambdaQueryWrapper<CommentEntity>()
.eq(CommentEntity::getThemeId, themeId)))
.size();
}
public Set<String> getCommentUserCount(List<String> themeIds) { public Set<String> getCommentUserCount(List<String> themeIds) {
return commentMapper.selectList((new LambdaQueryWrapper<CommentEntity>() return commentMapper.selectList((new LambdaQueryWrapper<CommentEntity>()
.in(CommentEntity::getThemeId, themeIds))) .in(CommentEntity::getThemeId, themeIds)))
......
...@@ -172,7 +172,7 @@ public class ThemeService { ...@@ -172,7 +172,7 @@ public class ThemeService {
public Integer getForwardCountById(String themeId) { public Integer getForwardCountById(String themeId) {
return themeMapper.selectCount(new LambdaQueryWrapper<ThemeEntity>() return themeMapper.selectCount(new LambdaQueryWrapper<ThemeEntity>()
.eq(ThemeEntity::getThemeId, themeId) .eq(ThemeEntity::getFormerThemeId, themeId)
.eq(ThemeEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED)); .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