Skip to content

Commit

Permalink
[Feat]: api - 챌린지그룹 id 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
bayy1216 committed Oct 9, 2024
1 parent ee038c8 commit 29d4d07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public static ChallengeRecordDetailDto from(ChallengeVerificationModel.Main mode

@Builder
public record ChallengeCurrentResponse(
Long challengeGroupId,
Long challengeId,
String title,
Integer successCount,
Expand All @@ -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())
Expand All @@ -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,
Expand All @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public static Record from(

@Builder
public record Current(
Long challengeGroupId,
Long challengeId,
String title,
Integer totalCount,
Expand All @@ -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())
Expand All @@ -69,6 +71,7 @@ public static Current from(UserChallenge userChallenge, Boolean reviewWritten) {

@Builder
public record Complete(
Long challengeGroupId,
Long challengeId,
String title,
LocalDate successDate,
Expand All @@ -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())
// 성공한 날짜는 가장 최근에 인증한 날짜로 설정
Expand Down

0 comments on commit 29d4d07

Please sign in to comment.