Skip to content

Commit

Permalink
API 버그 수정 (LocalDateTime field에 대한 버그 수정)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeGenieee committed Oct 31, 2023
1 parent cf38263 commit 00ee059
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ public class ReservationService {

private final Logger logger = LoggerFactory.getLogger(ReservationService.class);

@Transactional
public List<Reservation> makeReservations(Show show, ReservationRequest request) {

User user = userService.get(request.userId());

LocalDateTime showTime = request.showTime();

List<ReservationSeatRequest> seats = request.seatGradeList();
List<ReservationSeatRequest> seats = request.reservationSeatRequests();

return makeReservations(user, show, showTime, seats);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public interface ReservationRepository extends JpaRepository<Reservation, Long>
@Query(value = "select r from Reservation r where r.showSeat = :scheduledShowSeat")
@Lock(LockModeType.PESSIMISTIC_WRITE)
@QueryHints({
@QueryHint(name = "javax.persistence.lock.timeout", value = "1000")
@QueryHint(name = "jakarta.persistence.lock.timeout", value = "1000")
})
List<Reservation> findByShowSeatWithPessimisticLock(
@Param("scheduledShowSeat") ScheduledShowSeat scheduledShowSeat);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public Page<ShowMainResponse> getShowListWithPagination(
public RemainingSeatsResponse getRemainingSeatCountsByShowAndTime(
@PathVariable Long showId,
@RequestParam(value = "showTime", required = true)
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") LocalDateTime showTime
@DateTimeFormat(pattern = "yyyy-MM-ddTHH:mm") LocalDateTime showTime
) {
return seatGradeFactory.convertRemainingSeats(
showService.getRemainingSeats(showId, showTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public record ReservationRequest(
@Positive
Long userId,

@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
@DateTimeFormat(pattern = "yyyy-MM-ddTHH:mm")
LocalDateTime showTime,
List<ReservationSeatRequest> seatGradeList
List<ReservationSeatRequest> reservationSeatRequests
) {

@Builder
Expand Down

0 comments on commit 00ee059

Please sign in to comment.