From fb5eb5a2bb1140728fbb71556b6a28a5a123048c Mon Sep 17 00:00:00 2001 From: Dongyun Kim Date: Thu, 14 Nov 2024 00:03:05 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20#33=20=EC=BB=A4=EC=84=9C=20=EA=B0=92?= =?UTF-8?q?=EC=9D=84=EC=9C=84=ED=95=9C=20=EC=83=9D=EC=84=B1=EC=9D=BC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xcellentbe/domain/article/dto/ArticleResponseDto.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/leets/xcellentbe/domain/article/dto/ArticleResponseDto.java b/src/main/java/com/leets/xcellentbe/domain/article/dto/ArticleResponseDto.java index 8e2f838..14803e9 100644 --- a/src/main/java/com/leets/xcellentbe/domain/article/dto/ArticleResponseDto.java +++ b/src/main/java/com/leets/xcellentbe/domain/article/dto/ArticleResponseDto.java @@ -1,5 +1,6 @@ package com.leets.xcellentbe.domain.article.dto; +import java.time.LocalDateTime; import java.util.List; import java.util.Map; import java.util.UUID; @@ -33,12 +34,13 @@ public class ArticleResponseDto { private long likeCnt; private long commentCnt; private boolean owner; + private LocalDateTime createdAt; @Builder private ArticleResponseDto(UUID articleId, String userName, String customId, String content, DeletedStatus deletedStatus, List hashtags, UUID rePostId, List mediaUrls, List comments, - int viewCnt, long rePostCnt, long likeCnt, long commentCnt, boolean owner) { + int viewCnt, long rePostCnt, long likeCnt, long commentCnt, boolean owner, LocalDateTime createdAt) { this.articleId = articleId; this.userName = userName; this.customId = customId; @@ -53,6 +55,7 @@ private ArticleResponseDto(UUID articleId, String userName, String customId, Str this.commentCnt = commentCnt; this.owner = owner; this.comments = comments; + this.createdAt = createdAt; } public static ArticleResponseDto from(Article article, boolean isOwner, ArticleStatsDto stats, @@ -88,6 +91,7 @@ public static ArticleResponseDto from(Article article, boolean isOwner, ArticleS .likeCnt(stats.getLikeCnt()) .commentCnt(stats.getCommentCnt()) .owner(isOwner) + .createdAt(article.getCreatedAt()) .build(); } @@ -113,6 +117,7 @@ public static ArticleResponseDto fromWithoutComments(Article article, boolean is .likeCnt(stats.getLikeCnt()) .commentCnt(stats.getCommentCnt()) .owner(isOwner) + .createdAt(article.getCreatedAt()) .build(); } }