optimize(backend): optimize /api/posts/latest-reply

resolves #554
This commit is contained in:
netcat
2025-08-14 17:53:01 +08:00
parent 53c603f33a
commit 1e87e9252d
5 changed files with 64 additions and 2 deletions

View File

@@ -60,7 +60,8 @@ 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(commentService.countComments(post.getId()));
//dto.setCommentCount(commentService.countComments(post.getId()));
dto.setCommentCount(post.getCommentCount());
dto.setStatus(post.getStatus());
dto.setPinnedAt(post.getPinnedAt());