diff --git a/src/main/java/com/example/CatchStudy/controller/BookingController.java b/src/main/java/com/example/CatchStudy/controller/BookingController.java index cab3633..510b581 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 );