mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-07-17 10:06:10 +00:00
fix: comment count 放在last_reply_at后更新,确保数据正确
This commit is contained in:
@@ -67,7 +67,6 @@ public class PostMapper {
|
|||||||
dto.setCategory(categoryMapper.toDto(post.getCategory()));
|
dto.setCategory(categoryMapper.toDto(post.getCategory()));
|
||||||
dto.setTags(post.getTags().stream().map(tagMapper::toDto).collect(Collectors.toList()));
|
dto.setTags(post.getTags().stream().map(tagMapper::toDto).collect(Collectors.toList()));
|
||||||
dto.setViews(post.getViews());
|
dto.setViews(post.getViews());
|
||||||
dto.setCommentCount(post.getCommentCount());
|
|
||||||
dto.setStatus(post.getStatus());
|
dto.setStatus(post.getStatus());
|
||||||
dto.setPinnedAt(post.getPinnedAt());
|
dto.setPinnedAt(post.getPinnedAt());
|
||||||
dto.setRssExcluded(post.getRssExcluded() == null || post.getRssExcluded());
|
dto.setRssExcluded(post.getRssExcluded() == null || post.getRssExcluded());
|
||||||
@@ -86,6 +85,7 @@ public class PostMapper {
|
|||||||
if (last == null) {
|
if (last == null) {
|
||||||
commentService.updatePostCommentStats(post);
|
commentService.updatePostCommentStats(post);
|
||||||
}
|
}
|
||||||
|
dto.setCommentCount(post.getCommentCount());
|
||||||
dto.setLastReplyAt(post.getLastReplyAt());
|
dto.setLastReplyAt(post.getLastReplyAt());
|
||||||
dto.setReward(0);
|
dto.setReward(0);
|
||||||
dto.setSubscribed(false);
|
dto.setSubscribed(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user