From 29d4d07a812c655baf2e1452004f95e5d58c9822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=86=90=ED=99=8D=EC=84=9D?= <78216059+bayy1216@users.noreply.github.com> Date: Wed, 9 Oct 2024 13:42:49 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]:=20api=20-=20=EC=B1=8C=EB=A6=B0=EC=A7=80?= =?UTF-8?q?=EA=B7=B8=EB=A3=B9=20id=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zzansuni/userchallenge/controller/ChallengeRes.java | 4 ++++ .../userchallenge/domain/application/UserChallengeModel.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/controller/ChallengeRes.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/controller/ChallengeRes.java index 6e8af2e..d079dc0 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/controller/ChallengeRes.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/controller/ChallengeRes.java @@ -75,6 +75,7 @@ public static ChallengeRecordDetailDto from(ChallengeVerificationModel.Main mode @Builder public record ChallengeCurrentResponse( + Long challengeGroupId, Long challengeId, String title, Integer successCount, @@ -91,6 +92,7 @@ public record ChallengeCurrentResponse( public static ChallengeCurrentResponse from(UserChallengeModel.Current current) { return ChallengeCurrentResponse.builder() + .challengeGroupId(current.challengeGroupId()) .challengeId(current.challengeId()) .title(current.title()) .successCount(current.successCount()) @@ -107,6 +109,7 @@ public static ChallengeCurrentResponse from(UserChallengeModel.Current current) @Builder public record ChallengeCompleteResponse( Long id, + Long challengeGroupId, String title, LocalDate successDate, ChallengeCategory category, @@ -116,6 +119,7 @@ public record ChallengeCompleteResponse( public static ChallengeCompleteResponse from(UserChallengeModel.Complete complete) { return ChallengeCompleteResponse.builder() .id(complete.challengeId()) + .challengeGroupId(complete.challengeGroupId()) .title(complete.title()) .successDate(complete.successDate()) .category(complete.category()) diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/UserChallengeModel.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/UserChallengeModel.java index 6609f75..a5e5b4a 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/UserChallengeModel.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/UserChallengeModel.java @@ -41,6 +41,7 @@ public static Record from( @Builder public record Current( + Long challengeGroupId, Long challengeId, String title, Integer totalCount, @@ -55,6 +56,7 @@ public record Current( public static Current from(UserChallenge userChallenge, Boolean reviewWritten) { Challenge challenge = userChallenge.getChallenge(); return Current.builder() + .challengeGroupId(challenge.getChallengeGroupId()) .challengeId(challenge.getId()) .title(challenge.getChallengeGroup().getTitle()) .totalCount(challenge.getRequiredCount()) @@ -69,6 +71,7 @@ public static Current from(UserChallenge userChallenge, Boolean reviewWritten) { @Builder public record Complete( + Long challengeGroupId, Long challengeId, String title, LocalDate successDate, @@ -81,6 +84,7 @@ public static Complete from(UserChallenge userChallenge, Boolean reviewWritten Challenge challenge = userChallenge.getChallenge(); return Complete.builder() + .challengeGroupId(challenge.getChallengeGroupId()) .challengeId(challenge.getId()) .title(challenge.getChallengeGroup().getTitle()) // 성공한 날짜는 가장 최근에 인증한 날짜로 설정