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()); } }