fix: comment count 放在last_reply_at后更新,确保数据正确

This commit is contained in:
Tim
2025-09-17 14:16:49 +08:00
parent f67e220894
commit 3d0d0496b6

View File

@@ -67,7 +67,6 @@ public class PostMapper {
dto.setCategory(categoryMapper.toDto(post.getCategory()));
dto.setTags(post.getTags().stream().map(tagMapper::toDto).collect(Collectors.toList()));
dto.setViews(post.getViews());
dto.setCommentCount(post.getCommentCount());
dto.setStatus(post.getStatus());
dto.setPinnedAt(post.getPinnedAt());
dto.setRssExcluded(post.getRssExcluded() == null || post.getRssExcluded());
@@ -86,6 +85,7 @@ public class PostMapper {
if (last == null) {
commentService.updatePostCommentStats(post);
}
dto.setCommentCount(post.getCommentCount());
dto.setLastReplyAt(post.getLastReplyAt());
dto.setReward(0);
dto.setSubscribed(false);