diff --git a/community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java b/community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java index 7150e675994632971239528ac516657099a58136..6762017f4b831418a9e8d4459b17964b9b218a03 100644 --- a/community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java +++ b/community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java @@ -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); } diff --git a/community-service/src/main/java/com/tanpu/community/service/CommentService.java b/community-service/src/main/java/com/tanpu/community/service/CommentService.java index c09bf1f9a11a6c7b9070f4bd407ec094dc9dc550..989321a5da9e1613c982fcd97fbed71d601fd313 100644 --- a/community-service/src/main/java/com/tanpu/community/service/CommentService.java +++ b/community-service/src/main/java/com/tanpu/community/service/CommentService.java @@ -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))) diff --git a/community-service/src/main/java/com/tanpu/community/service/ThemeService.java b/community-service/src/main/java/com/tanpu/community/service/ThemeService.java index 059145ea8b324891c55db14aedac6ccfa45333e3..33bdd8db4fe21c8628350b40f12dd66b44f29524 100644 --- a/community-service/src/main/java/com/tanpu/community/service/ThemeService.java +++ b/community-service/src/main/java/com/tanpu/community/service/ThemeService.java @@ -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)); }