Skip to content

Commit

Permalink
fix: #33 커서 값을위한 생성일 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
dyk-im committed Nov 13, 2024
1 parent 040f0bd commit fb5eb5a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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<String> hashtags, UUID rePostId, List<String> mediaUrls, List<CommentResponseDto> 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;
Expand All @@ -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,
Expand Down Expand Up @@ -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();
}

Expand All @@ -113,6 +117,7 @@ public static ArticleResponseDto fromWithoutComments(Article article, boolean is
.likeCnt(stats.getLikeCnt())
.commentCnt(stats.getCommentCnt())
.owner(isOwner)
.createdAt(article.getCreatedAt())
.build();
}
}

0 comments on commit fb5eb5a

Please sign in to comment.