From 6807399968d79f955e597ffa3c6d2207c0757adc Mon Sep 17 00:00:00 2001 From: Zoonmy Date: Fri, 25 Oct 2024 12:21:21 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20challenge=20preview=20dto=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/hyundai/blog/challenge/dto/ChallengePreviewDto.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BE/Blog/src/main/java/hyundai/blog/challenge/dto/ChallengePreviewDto.java b/BE/Blog/src/main/java/hyundai/blog/challenge/dto/ChallengePreviewDto.java index 22e81a3..fee1e42 100644 --- a/BE/Blog/src/main/java/hyundai/blog/challenge/dto/ChallengePreviewDto.java +++ b/BE/Blog/src/main/java/hyundai/blog/challenge/dto/ChallengePreviewDto.java @@ -8,13 +8,16 @@ import java.time.LocalDateTime; public record ChallengePreviewDto( + Long challengeId, String algorithm, String title, Long views, LocalDateTime createdAt ) { + public static ChallengePreviewDto of(Challenge challenge) { return new ChallengePreviewDto( + challenge.getId(), challenge.getAlgorithm(), challenge.getTitle(), challenge.getViews(),