From d6a18fa6a2c06bbceb9345245aface5d0864145e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A1=E1=86=AB=E1=84=82=E1=85=A1=E1=84=8B?= =?UTF-8?q?=E1=85=A7=E1=86=BC?= Date: Tue, 4 Jun 2024 10:59:09 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=82=AC=EC=9A=A9=EC=9E=90=20?= =?UTF-8?q?=EB=B3=84=20=EC=9E=85=EA=B8=88=EC=95=A1=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?api=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hanaro/triptogether/dues/controller/DuesController.java | 6 +++--- .../com/hanaro/triptogether/dues/service/DuesService.java | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/hanaro/triptogether/dues/controller/DuesController.java b/src/main/java/com/hanaro/triptogether/dues/controller/DuesController.java index d21fc2f..ed26a5c 100644 --- a/src/main/java/com/hanaro/triptogether/dues/controller/DuesController.java +++ b/src/main/java/com/hanaro/triptogether/dues/controller/DuesController.java @@ -37,9 +37,9 @@ public BaseResponse getDuesRule(@PathVariable(value ="teamIdx" ) Long teamIdx) { return BaseResponse.res(ResponseStatus.SUCCESS,ResponseStatus.SUCCESS.getMessage(),duesService.getDuesRule(teamIdx)); } - @GetMapping("/details/amount") - public BaseResponse getDuesAllAmount(@RequestBody DuesDetailRequestDto duesDetailRequestDto){ - return BaseResponse.res(ResponseStatus.SUCCESS,ResponseStatus.SUCCESS.getMessage(),duesService.getDuesDetailTotalAmount(duesDetailRequestDto)); + @GetMapping("/details/{accIdx}/total-amount") + public BaseResponse getDuesAllAmount(@PathVariable("accIdx") Long accIdx, @RequestParam("memberIdx") Long memberIdx){ + return BaseResponse.res(ResponseStatus.SUCCESS,ResponseStatus.SUCCESS.getMessage(),duesService.getDuesDetailTotalAmount(accIdx,memberIdx)); } diff --git a/src/main/java/com/hanaro/triptogether/dues/service/DuesService.java b/src/main/java/com/hanaro/triptogether/dues/service/DuesService.java index ae27929..7828eb7 100644 --- a/src/main/java/com/hanaro/triptogether/dues/service/DuesService.java +++ b/src/main/java/com/hanaro/triptogether/dues/service/DuesService.java @@ -3,7 +3,6 @@ import com.hanaro.triptogether.account.domain.AccountTransactionDetailsRepository; import com.hanaro.triptogether.dues.domain.entity.Dues; import com.hanaro.triptogether.dues.domain.repository.DuesRepository; -import com.hanaro.triptogether.dues.dto.request.DuesDetailRequestDto; import com.hanaro.triptogether.dues.dto.request.DuesRuleRequestDto; import com.hanaro.triptogether.dues.dto.response.*; import com.hanaro.triptogether.teamMember.domain.TeamMember; @@ -13,7 +12,6 @@ import java.math.BigDecimal; import java.time.YearMonth; -import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List; @@ -26,8 +24,8 @@ public class DuesService { private final TeamMemberRepository teamMemberRepository; - public DuesDetailTotalAmountResponseDto getDuesDetailTotalAmount(DuesDetailRequestDto duesDetailRequestDto) { - return accountTransactionDetailsRepository.findSumOfTransAmountByMemberIdx(duesDetailRequestDto.getAccIdx(),duesDetailRequestDto.getMemberIdx()); + public DuesDetailTotalAmountResponseDto getDuesDetailTotalAmount(Long accIdx, Long memberIdx) { + return accountTransactionDetailsRepository.findSumOfTransAmountByMemberIdx(accIdx,memberIdx); } public List getDuesDetailByMonthAmount(Long accIdx, Long memberIdx, String duesYear){