diff --git a/src/main/java/com/fledge/fledgeserver/challenge/dto/response/ChallengeDetailResponse.java b/src/main/java/com/fledge/fledgeserver/challenge/dto/response/ChallengeDetailResponse.java index c9002e2..931bc06 100644 --- a/src/main/java/com/fledge/fledgeserver/challenge/dto/response/ChallengeDetailResponse.java +++ b/src/main/java/com/fledge/fledgeserver/challenge/dto/response/ChallengeDetailResponse.java @@ -15,9 +15,9 @@ public class ChallengeDetailResponse extends ChallengeResponse { @Schema(description = "사용자 참여 여부", example = "true") private boolean isParticipating; - public ChallengeDetailResponse(String title, int likeCount, List categories, String type, + public ChallengeDetailResponse(long id, String title, int likeCount, List categories, String type, String description, double successRate, int successCount, int participantCount, boolean isParticipating) { - super(title, likeCount, categories, type, description, successRate, successCount, participantCount, null, null, null); + super(id, title, likeCount, categories, type, description, successRate, successCount, participantCount, null, null, null); this.isParticipating = isParticipating; } } diff --git a/src/main/java/com/fledge/fledgeserver/challenge/dto/response/ChallengeResponse.java b/src/main/java/com/fledge/fledgeserver/challenge/dto/response/ChallengeResponse.java index 17a0b69..79b1821 100644 --- a/src/main/java/com/fledge/fledgeserver/challenge/dto/response/ChallengeResponse.java +++ b/src/main/java/com/fledge/fledgeserver/challenge/dto/response/ChallengeResponse.java @@ -15,6 +15,9 @@ @Schema(description = "챌린지 응답 DTO") public class ChallengeResponse { + @Schema(description = "챌린지 id", example = "1") + private final long id; + @Schema(description = "챌린지 제목", example = "챌린지 타이틀") private final String title; diff --git a/src/main/java/com/fledge/fledgeserver/challenge/service/ChallengeService.java b/src/main/java/com/fledge/fledgeserver/challenge/service/ChallengeService.java index b278e1b..ae3e802 100644 --- a/src/main/java/com/fledge/fledgeserver/challenge/service/ChallengeService.java +++ b/src/main/java/com/fledge/fledgeserver/challenge/service/ChallengeService.java @@ -53,6 +53,7 @@ public ChallengeDetailResponse getChallengeById(Long challengeId) { boolean isParticipating = SecurityUtils.isAuthenticated() && challengeParticipationRepository.existsByMemberIdAndChallengeId(SecurityUtils.getCurrentUserId(), challengeId); return new ChallengeDetailResponse( + challenge.getId(), challenge.getTitle(), challenge.getLikeCount(), challenge.getCategories(), @@ -107,6 +108,7 @@ private Page getChallengesByTypeAndCategories(int page, int s private ChallengeResponse createChallengeResponse(Challenge challenge) { return new ChallengeResponse( + challenge.getId(), challenge.getTitle(), challenge.getLikeCount(), challenge.getCategories(), @@ -121,6 +123,7 @@ private ChallengeResponse createChallengeResponse(Challenge challenge) { private ChallengeResponse createChallengeResponseWithSupport(Challenge challenge) { return new ChallengeResponse( + challenge.getId(), challenge.getTitle(), challenge.getLikeCount(), challenge.getCategories(),