diff --git a/src/main/java/com/api/trip/domain/article/controller/dto/GetArticlesResponse.java b/src/main/java/com/api/trip/domain/article/controller/dto/GetArticlesResponse.java index c8f9f73..d4c86f6 100644 --- a/src/main/java/com/api/trip/domain/article/controller/dto/GetArticlesResponse.java +++ b/src/main/java/com/api/trip/domain/article/controller/dto/GetArticlesResponse.java @@ -45,8 +45,9 @@ private static class ArticleDto { private Long writerId; private String writerNickname; private String writerRole; - private LocalDateTime createdAt; + private long viewCount; private long likeCount; + private LocalDateTime createdAt; private static ArticleDto of(Article article) { Member writer = article.getWriter(); @@ -56,8 +57,9 @@ private static ArticleDto of(Article article) { .writerId(writer.getId()) .writerNickname(writer.getNickname()) .writerRole(writer.getRole().name()) - .createdAt(article.getCreatedAt()) + .viewCount(article.getViewCount()) .likeCount(article.getLikeCount()) + .createdAt(article.getCreatedAt()) .build(); } } diff --git a/src/main/java/com/api/trip/domain/article/controller/dto/ReadArticleResponse.java b/src/main/java/com/api/trip/domain/article/controller/dto/ReadArticleResponse.java index f3ae41f..f853c14 100644 --- a/src/main/java/com/api/trip/domain/article/controller/dto/ReadArticleResponse.java +++ b/src/main/java/com/api/trip/domain/article/controller/dto/ReadArticleResponse.java @@ -17,8 +17,10 @@ public class ReadArticleResponse { private Long writerId; private String writerNickname; private String writerRole; + private String writerProfileImg; private String content; private long viewCount; + private long likeCount; private LocalDateTime createdAt; private Long interestArticleId; @@ -29,9 +31,11 @@ public static ReadArticleResponse of(Article article, InterestArticle interestAr .title(article.getTitle()) .writerId(writer.getId()) .writerNickname(writer.getNickname()) + .writerProfileImg(writer.getProfileImg()) .writerRole(writer.getRole().name()) .content(article.getContent()) - .viewCount(article.getViewCount()) + .viewCount(article.getViewCount() + 1) + .likeCount(article.getLikeCount()) .createdAt(article.getCreatedAt()) .interestArticleId(interestArticle != null ? interestArticle.getId() : null) .build(); diff --git a/src/main/java/com/api/trip/domain/comment/controller/dto/GetCommentsResponse.java b/src/main/java/com/api/trip/domain/comment/controller/dto/GetCommentsResponse.java index 95f86d4..d615b8d 100644 --- a/src/main/java/com/api/trip/domain/comment/controller/dto/GetCommentsResponse.java +++ b/src/main/java/com/api/trip/domain/comment/controller/dto/GetCommentsResponse.java @@ -45,6 +45,7 @@ private static class CommentDto { private Long commentId; private Long writerId; private String writerNickname; + private String writerProfileImg; private Long articleId; private String content; private Long parentId; @@ -58,6 +59,7 @@ private static CommentDto of(Comment comment) { .commentId(comment.getId()) .writerId(comment.getWriter().getId()) .writerNickname(comment.getWriter().getNickname()) + .writerProfileImg(comment.getWriter().getProfileImg()) .articleId(comment.getArticle().getId()) .content(comment.getContent()) .parentId(comment.getParent() != null ? comment.getParent().getId() : null)