From 6502e190c9f2b63cde14bce269fc83ea0597c165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EB=8B=A4=EC=9D=80?= Date: Fri, 26 Jul 2024 16:34:08 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[#151]=20fix=20:=20=EA=B2=B0=EC=A0=9C=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=98=A4=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 --- .../CatchStudy/controller/BookingController.java | 9 +++++++-- .../domain/dto/request/BookingRequestDto.java | 10 +++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/example/CatchStudy/controller/BookingController.java b/src/main/java/com/example/CatchStudy/controller/BookingController.java index cab3633..9cce393 100644 --- a/src/main/java/com/example/CatchStudy/controller/BookingController.java +++ b/src/main/java/com/example/CatchStudy/controller/BookingController.java @@ -35,9 +35,14 @@ public Response bookingSeats(@RequestBody BookingRequestDto User user = (User) authentication.getPrincipal(); Long userId = usersRepository.findByEmail(user.getUsername()).getUserId(); SeatBookingDto dto = null; - if (bookingRequestDto.getType().equals(SeatType.seat)) { + System.out.println("bookingrequest=========================="); + System.out.println(bookingRequestDto.getSeat_id()); + System.out.println(bookingRequestDto.getType()); + System.out.println(bookingRequestDto.getTime()); + System.out.println("bookingrequest=========================="); + if (bookingRequestDto.getType().equals("seat")) { dto = bookingRequestDto.toSeatDto(); - } else if (bookingRequestDto.getType().equals(SeatType.room)) { + } else if (bookingRequestDto.getType().equals("room")) { dto = bookingRequestDto.toRoomDto(); } BookingResponseDto bookingResponseDto = paymentService.kakaoPayReady(dto, userId); diff --git a/src/main/java/com/example/CatchStudy/domain/dto/request/BookingRequestDto.java b/src/main/java/com/example/CatchStudy/domain/dto/request/BookingRequestDto.java index dfda0e3..fb0592d 100644 --- a/src/main/java/com/example/CatchStudy/domain/dto/request/BookingRequestDto.java +++ b/src/main/java/com/example/CatchStudy/domain/dto/request/BookingRequestDto.java @@ -21,13 +21,13 @@ public class BookingRequestDto { PaymentType payment_type; Long room_id; - SeatType type; + String type; String start_time; - public static BookingRequestDto of(Long cafe_id, Long seat_id, Integer time, Integer amount, PaymentType payment_type, SeatType type) { + public static BookingRequestDto of(Long cafe_id, Long seat_id, Integer time, Integer amount, PaymentType payment_type, String type) { return new BookingRequestDto(cafe_id, seat_id, time, amount, payment_type, null, type, null); } - public static BookingRequestDto of(Long cafe_id, Integer time, Integer amount, PaymentType payment_type, Long room_Id, SeatType type, String start_time) { + public static BookingRequestDto of(Long cafe_id, Integer time, Integer amount, PaymentType payment_type, Long room_Id, String type, String start_time) { return new BookingRequestDto(cafe_id, null,time,amount,payment_type,room_Id,type,start_time); } @@ -38,7 +38,7 @@ public SeatBookingDto toSeatDto() { time, amount, payment_type, - type + SeatType.valueOf(type) ); } @@ -49,7 +49,7 @@ public SeatBookingDto toRoomDto() { amount, payment_type, room_id, - type, + SeatType.valueOf(type), start_time ); From 99247ba2171d7c406c11cf6f4468da3fec2b752c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EB=8B=A4=EC=9D=80?= Date: Fri, 26 Jul 2024 16:50:21 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[#151]=20fix:=20=EA=B2=B0=EC=A0=9C=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=98=A4=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 --- .../com/example/CatchStudy/controller/BookingController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/example/CatchStudy/controller/BookingController.java b/src/main/java/com/example/CatchStudy/controller/BookingController.java index 9cce393..510b581 100644 --- a/src/main/java/com/example/CatchStudy/controller/BookingController.java +++ b/src/main/java/com/example/CatchStudy/controller/BookingController.java @@ -35,11 +35,11 @@ public Response bookingSeats(@RequestBody BookingRequestDto User user = (User) authentication.getPrincipal(); Long userId = usersRepository.findByEmail(user.getUsername()).getUserId(); SeatBookingDto dto = null; - System.out.println("bookingrequest=========================="); + System.out.println("bookingrequest===================================="); System.out.println(bookingRequestDto.getSeat_id()); System.out.println(bookingRequestDto.getType()); System.out.println(bookingRequestDto.getTime()); - System.out.println("bookingrequest=========================="); + System.out.println("bookingrequest===================================="); if (bookingRequestDto.getType().equals("seat")) { dto = bookingRequestDto.toSeatDto(); } else if (bookingRequestDto.getType().equals("room")) {