diff --git a/src/main/java/org/kakaoshare/backend/domain/funding/controller/FundingController.java b/src/main/java/org/kakaoshare/backend/domain/funding/controller/FundingController.java index 334c6328e..12c85a3bc 100644 --- a/src/main/java/org/kakaoshare/backend/domain/funding/controller/FundingController.java +++ b/src/main/java/org/kakaoshare/backend/domain/funding/controller/FundingController.java @@ -51,12 +51,6 @@ public ResponseEntity checkFunding(@RequestBody FundingCheckRequest checkRequ return ResponseEntity.ok(response); } - @GetMapping("/funding/{fundingId}") - public ResponseEntity getFundingProgress(@PathVariable Long fundingId, @LoggedInMember String providerId) { - ProgressResponse response = fundingService.getFundingItemProgress(fundingId, providerId); - return ResponseEntity.ok(response); - } - @PostMapping("/funding/friendItem") public ResponseEntity getFriendFundingProgress(@LoggedInMember String providerId, @RequestBody FriendFundingInquiryRequest inquiryRequest) { diff --git a/src/main/java/org/kakaoshare/backend/domain/funding/dto/inquiry/FriendFundingInquiryRequest.java b/src/main/java/org/kakaoshare/backend/domain/funding/dto/inquiry/FriendFundingInquiryRequest.java index 8a39af61e..764120d58 100644 --- a/src/main/java/org/kakaoshare/backend/domain/funding/dto/inquiry/FriendFundingInquiryRequest.java +++ b/src/main/java/org/kakaoshare/backend/domain/funding/dto/inquiry/FriendFundingInquiryRequest.java @@ -6,6 +6,5 @@ @Getter @Builder public class FriendFundingInquiryRequest { - private final Long fundingId; private final String friendProviderId; } diff --git a/src/main/java/org/kakaoshare/backend/domain/funding/service/FundingService.java b/src/main/java/org/kakaoshare/backend/domain/funding/service/FundingService.java index 9e76b535f..5f91bc3db 100644 --- a/src/main/java/org/kakaoshare/backend/domain/funding/service/FundingService.java +++ b/src/main/java/org/kakaoshare/backend/domain/funding/service/FundingService.java @@ -91,9 +91,9 @@ public ProgressResponse getMyFundingProgress(String providerId) { public ProgressResponse getFriendFundingProgress(String providerId, FriendFundingInquiryRequest inquiryRequest) { Member self = findMemberByProviderId(providerId); Member friend = findMemberByProviderId(inquiryRequest.getFriendProviderId()); //todo 친구 검증 메소드 추가해야함 - Funding funding = findByIdAndMemberId(inquiryRequest.getFundingId(), friend.getMemberId()); - - return getFundingProgress(funding.getFundingId(), friend.getMemberId()); + return fundingRepository.findByMemberIdAndStatus(friend.getMemberId(), FundingStatus.PROGRESS) + .map(funding -> getFundingProgress(funding.getFundingId(), friend.getMemberId())) + .orElse(new ProgressResponse()); } public PageResponse getMyFilteredFundingProducts(String providerId, FundingStatus status,