diff --git a/src/main/java/co/orange/ddanzi/dto/payment/CreatePaymentResponseDto.java b/src/main/java/co/orange/ddanzi/dto/payment/CreatePaymentResponseDto.java index 5cd35e7b..525e2fd0 100644 --- a/src/main/java/co/orange/ddanzi/dto/payment/CreatePaymentResponseDto.java +++ b/src/main/java/co/orange/ddanzi/dto/payment/CreatePaymentResponseDto.java @@ -9,7 +9,7 @@ @Getter @Builder public class CreatePaymentResponseDto { - private Long paymentId; + private String paymentId; private PayStatus payStatus; private LocalDateTime startedAt; } diff --git a/src/main/java/co/orange/ddanzi/dto/payment/UpdatePaymentRequestDto.java b/src/main/java/co/orange/ddanzi/dto/payment/UpdatePaymentRequestDto.java index caf70034..dc46c82f 100644 --- a/src/main/java/co/orange/ddanzi/dto/payment/UpdatePaymentRequestDto.java +++ b/src/main/java/co/orange/ddanzi/dto/payment/UpdatePaymentRequestDto.java @@ -5,6 +5,6 @@ @Getter public class UpdatePaymentRequestDto { - private Long paymentId; + private String paymentId; private PayStatus payStatus; } diff --git a/src/main/java/co/orange/ddanzi/dto/payment/UpdatePaymentResponseDto.java b/src/main/java/co/orange/ddanzi/dto/payment/UpdatePaymentResponseDto.java index 2409917e..0f108a77 100644 --- a/src/main/java/co/orange/ddanzi/dto/payment/UpdatePaymentResponseDto.java +++ b/src/main/java/co/orange/ddanzi/dto/payment/UpdatePaymentResponseDto.java @@ -9,7 +9,7 @@ @Getter @Builder public class UpdatePaymentResponseDto { - private Long paymentId; + private String paymentId; private PayStatus payStatus; private LocalDateTime endedAt; } diff --git a/src/main/java/co/orange/ddanzi/service/PaymentService.java b/src/main/java/co/orange/ddanzi/service/PaymentService.java index 516ae5fc..b651fc80 100644 --- a/src/main/java/co/orange/ddanzi/service/PaymentService.java +++ b/src/main/java/co/orange/ddanzi/service/PaymentService.java @@ -51,8 +51,10 @@ public ApiResponse startPayment(CreatePaymentRequestDto requestDto){ product.updateStock(product.getStock() - 1); log.info("Update stock of product, product_id: {}", product.getId()); + /////////////////////////////////////////////////////////////////////////////////////////// + // 형변환 해놨음 다시 수정필요 CreatePaymentResponseDto responseDto = CreatePaymentResponseDto.builder() - .paymentId(payment.getId()) + .paymentId(payment.getId().toString()) .payStatus(payment.getPayStatus()) .startedAt(payment.getStartedAt()) .build(); @@ -61,8 +63,9 @@ public ApiResponse startPayment(CreatePaymentRequestDto requestDto){ @Transactional public ApiResponse endPayment(UpdatePaymentRequestDto requestDto){ - - Payment payment = paymentRepository.findById(requestDto.getPaymentId()).orElseThrow(()-> new PaymentNotFoundException()); + /////////////////////////////////////////////////////////////////////////////////////////// + // 형변환 해놨음 다시 수정필요 + Payment payment = paymentRepository.findById(Long.parseLong(requestDto.getPaymentId())).orElseThrow(()-> new PaymentNotFoundException()); Item item = payment.getItem(); Product product = item.getProduct(); @@ -79,9 +82,10 @@ public ApiResponse endPayment(UpdatePaymentRequestDto requestDto){ product.updateStock(product.getStock() + 1); } - + /////////////////////////////////////////////////////////////////////////////////////////// + // 형변환 해놨음 다시 수정필요 UpdatePaymentResponseDto responseDto = UpdatePaymentResponseDto.builder() - .paymentId(payment.getId()) + .paymentId(payment.getId().toString()) .payStatus(payment.getPayStatus()) .endedAt(payment.getEndedAt()) .build();