1
1
package com .leets .xcellentbe .domain .article .dto ;
2
2
3
+ import java .time .LocalDateTime ;
3
4
import java .util .List ;
4
5
import java .util .Map ;
5
6
import java .util .UUID ;
@@ -33,12 +34,13 @@ public class ArticleResponseDto {
33
34
private long likeCnt ;
34
35
private long commentCnt ;
35
36
private boolean owner ;
37
+ private LocalDateTime createdAt ;
36
38
37
39
@ Builder
38
40
private ArticleResponseDto (UUID articleId , String userName , String customId , String content ,
39
41
DeletedStatus deletedStatus ,
40
42
List <String > hashtags , UUID rePostId , List <String > mediaUrls , List <CommentResponseDto > comments ,
41
- int viewCnt , long rePostCnt , long likeCnt , long commentCnt , boolean owner ) {
43
+ int viewCnt , long rePostCnt , long likeCnt , long commentCnt , boolean owner , LocalDateTime createdAt ) {
42
44
this .articleId = articleId ;
43
45
this .userName = userName ;
44
46
this .customId = customId ;
@@ -53,6 +55,7 @@ private ArticleResponseDto(UUID articleId, String userName, String customId, Str
53
55
this .commentCnt = commentCnt ;
54
56
this .owner = owner ;
55
57
this .comments = comments ;
58
+ this .createdAt = createdAt ;
56
59
}
57
60
58
61
public static ArticleResponseDto from (Article article , boolean isOwner , ArticleStatsDto stats ,
@@ -88,6 +91,7 @@ public static ArticleResponseDto from(Article article, boolean isOwner, ArticleS
88
91
.likeCnt (stats .getLikeCnt ())
89
92
.commentCnt (stats .getCommentCnt ())
90
93
.owner (isOwner )
94
+ .createdAt (article .getCreatedAt ())
91
95
.build ();
92
96
}
93
97
@@ -113,6 +117,7 @@ public static ArticleResponseDto fromWithoutComments(Article article, boolean is
113
117
.likeCnt (stats .getLikeCnt ())
114
118
.commentCnt (stats .getCommentCnt ())
115
119
.owner (isOwner )
120
+ .createdAt (article .getCreatedAt ())
116
121
.build ();
117
122
}
118
123
}
0 commit comments