From 6f54449286551e397a1185b5526f01d11c48bc3a Mon Sep 17 00:00:00 2001 From: yang Date: Tue, 19 Mar 2024 03:09:19 +0900 Subject: [PATCH] =?UTF-8?q?RAC-325=20fix=20:=20=EA=B2=B0=EC=A0=9C=ED=83=AD?= =?UTF-8?q?=20=EB=A9=98=ED=86=A0=EB=A7=81=20=EC=A1=B0=ED=9A=8C=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/usecase/AdminMentoringUseCase.java | 8 -------- .../adminssr/application/usecase/AdminPaymentUseCase.java | 8 ++++++++ .../presentation/AdminWithThymeLeafController.java | 8 ++++++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminMentoringUseCase.java b/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminMentoringUseCase.java index 7edf286f..cecdb721 100644 --- a/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminMentoringUseCase.java +++ b/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminMentoringUseCase.java @@ -3,7 +3,6 @@ import com.postgraduate.domain.admin.application.dto.MentoringInfo; import com.postgraduate.domain.admin.application.dto.UserMentoringInfo; import com.postgraduate.domain.admin.application.dto.res.MentoringManageResponse; -import com.postgraduate.domain.admin.application.dto.res.MentoringWithPaymentResponse; import com.postgraduate.domain.admin.application.mapper.AdminMapper; import com.postgraduate.domain.mentoring.domain.entity.Mentoring; import com.postgraduate.domain.mentoring.domain.service.MentoringGetService; @@ -24,7 +23,6 @@ import java.util.List; -import static com.postgraduate.domain.admin.application.mapper.AdminMapper.mapToMentoringWithPaymentResponse; import static com.postgraduate.domain.admin.application.mapper.AdminMapper.mapToUserMentoringInfo; import static com.postgraduate.domain.mentoring.domain.entity.constant.Status.DONE; @@ -61,12 +59,6 @@ public MentoringManageResponse userMentoringInfos(Long userId) { return new MentoringManageResponse(mentoringInfos, userInfo); } - public MentoringWithPaymentResponse paymentMentoringInfo(Long paymentId) { - Payment payment = paymentGetService.byId(paymentId); - Mentoring mentoring = mentoringGetService.byPayment(payment); - return mapToMentoringWithPaymentResponse(mentoring); - } - public void refundMentoring(User user, Long mentoringId) { Mentoring mentoring = mentoringGetService.byMentoringId(mentoringId); Payment payment = mentoring.getPayment(); diff --git a/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminPaymentUseCase.java b/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminPaymentUseCase.java index e66ab04c..4a78ccd4 100644 --- a/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminPaymentUseCase.java +++ b/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminPaymentUseCase.java @@ -1,6 +1,7 @@ package com.postgraduate.domain.adminssr.application.usecase; import com.postgraduate.domain.admin.application.dto.PaymentInfo; +import com.postgraduate.domain.admin.application.dto.res.MentoringWithPaymentResponse; import com.postgraduate.domain.mentoring.domain.entity.Mentoring; import com.postgraduate.domain.mentoring.domain.service.MentoringGetService; import com.postgraduate.domain.payment.application.usecase.PaymentManageUseCase; @@ -13,6 +14,7 @@ import java.util.List; +import static com.postgraduate.domain.admin.application.mapper.AdminMapper.mapToMentoringWithPaymentResponse; import static com.postgraduate.domain.admin.application.mapper.AdminMapper.mapToPaymentInfo; @Service @@ -35,6 +37,12 @@ public List paymentInfos() { .toList(); } + public MentoringWithPaymentResponse paymentMentoringInfo(Long paymentId) { + Payment payment = paymentGetService.byId(paymentId); + Mentoring mentoring = mentoringGetService.byPayment(payment); + return mapToMentoringWithPaymentResponse(mentoring); + } + public void refundPayment(User user, Long paymentId) { paymentManageUseCase.refundPayByAdmin(user, paymentId); } diff --git a/src/main/java/com/postgraduate/domain/adminssr/presentation/AdminWithThymeLeafController.java b/src/main/java/com/postgraduate/domain/adminssr/presentation/AdminWithThymeLeafController.java index 7dc439df..beab0220 100644 --- a/src/main/java/com/postgraduate/domain/adminssr/presentation/AdminWithThymeLeafController.java +++ b/src/main/java/com/postgraduate/domain/adminssr/presentation/AdminWithThymeLeafController.java @@ -3,6 +3,7 @@ import com.postgraduate.domain.admin.application.dto.*; import com.postgraduate.domain.admin.application.dto.res.CertificationDetailsResponse; import com.postgraduate.domain.admin.application.dto.res.MentoringManageResponse; +import com.postgraduate.domain.admin.application.dto.res.MentoringWithPaymentResponse; import com.postgraduate.domain.admin.application.dto.res.WishResponse; import com.postgraduate.domain.adminssr.application.dto.req.Login; import com.postgraduate.domain.adminssr.application.usecase.*; @@ -136,6 +137,13 @@ public String paymentInfo(Model model) { return "adminPayment"; } + @GetMapping("/payment/mentoring") + public String paymentWithMentoring(Long paymentId, Model model) { + MentoringWithPaymentResponse mentoringWithPaymentResponse = adminPaymentUseCase.paymentMentoringInfo(paymentId); + model.addAttribute("mentoringInfo", mentoringWithPaymentResponse); + return "paymentMentoring"; + } + @PostMapping("/payment/refund/{paymentId}") public String refundPayment(@AuthenticationPrincipal User user, @PathVariable Long paymentId) { adminPaymentUseCase.refundPayment(user, paymentId);