Skip to content

Commit

Permalink
Merge pull request #167 from fourix4/dev
Browse files Browse the repository at this point in the history
결제 기능 오류 수정
  • Loading branch information
llynn97 authored Jul 26, 2024
2 parents 5c9370a + 317a2fa commit deed904
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ public Response<BookingResponseDto> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -38,7 +38,7 @@ public SeatBookingDto toSeatDto() {
time,
amount,
payment_type,
type
SeatType.valueOf(type)
);
}

Expand All @@ -49,7 +49,7 @@ public SeatBookingDto toRoomDto() {
amount,
payment_type,
room_id,
type,
SeatType.valueOf(type),
start_time

);
Expand Down

0 comments on commit deed904

Please sign in to comment.