Skip to content

Commit

Permalink
Merge pull request #34 from Leets-Official/fix/#33/게시글-조회-커서-값-관련-수정
Browse files Browse the repository at this point in the history
[fix] 커서 값을위한 생성일 추가
  • Loading branch information
dyk-im authored Nov 13, 2024
2 parents 040f0bd + fb5eb5a commit 4244f59
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 4244f59

Please sign in to comment.