From b1d788efefe7204cd9216edfd4924bb11ce0cc29 Mon Sep 17 00:00:00 2001 From: letskuku Date: Fri, 1 Nov 2024 01:46:29 +0900 Subject: [PATCH] =?UTF-8?q?#270=20fix:=20PaymentGetCounselorResponse?= =?UTF-8?q?=EC=97=90=EC=84=9C=20total=20=ED=95=84=EB=93=9C=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sharemind/payment/application/PaymentServiceImpl.java | 3 +-- .../payment/dto/response/PaymentGetCounselorResponse.java | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/example/sharemind/payment/application/PaymentServiceImpl.java b/src/main/java/com/example/sharemind/payment/application/PaymentServiceImpl.java index 832a4ea8..12ac4c10 100644 --- a/src/main/java/com/example/sharemind/payment/application/PaymentServiceImpl.java +++ b/src/main/java/com/example/sharemind/payment/application/PaymentServiceImpl.java @@ -139,14 +139,13 @@ public PaymentGetCounselorResponses getPaymentsByCounselor(Long paymentId, Strin } Pageable pageable = PageRequest.of(DEFAULT_PAGE_NUMBER, PAYMENT_COUNSELOR_PAGE_SIZE); - Long finalTotal = total; Page page = (paymentId == 0 ? paymentRepository.findAllByCounselorAndCounselorStatusAndUpdatedAtIsBefore( counselor, counselorStatus, sortTime, pageable) : paymentRepository.findAllByPaymentIdLessThanAndCounselorAndCounselorStatusAndUpdatedAtIsBefore( paymentId, counselor, counselorStatus, sortTime, pageable)) - .map(payment -> PaymentGetCounselorResponse.of(payment, finalTotal)); + .map(PaymentGetCounselorResponse::of); return PaymentGetCounselorResponses.of(total, page.getContent()); } diff --git a/src/main/java/com/example/sharemind/payment/dto/response/PaymentGetCounselorResponse.java b/src/main/java/com/example/sharemind/payment/dto/response/PaymentGetCounselorResponse.java index b28f1720..61537e84 100644 --- a/src/main/java/com/example/sharemind/payment/dto/response/PaymentGetCounselorResponse.java +++ b/src/main/java/com/example/sharemind/payment/dto/response/PaymentGetCounselorResponse.java @@ -45,16 +45,13 @@ public class PaymentGetCounselorResponse { @Schema(description = "지급 계좌") private final String account; - @Schema(description = "금액 합계") - private final Long total; - - public static PaymentGetCounselorResponse of(Payment payment, Long total) { + public static PaymentGetCounselorResponse of(Payment payment) { Consult consult = payment.getConsult(); Boolean isChat = consult.getChat() != null; return new PaymentGetCounselorResponse(payment.getPaymentId(), consult.getCustomer().getNickname(), isChat, consult.getCost() - FEE, consult.getCost(), FEE, consult.getConsultedAt(), payment.getSettledAt(), - consult.getCounselor().getAccount(), total); + consult.getCounselor().getAccount()); } }