refactor: startOfDay 06:00 설정

This commit is contained in:
손창현
2022-07-01 03:55:33 +09:00
parent e189d5d7ee
commit f7396d7986

View File

@@ -31,9 +31,10 @@ public class MovieTimeServiceImpl implements MovieTimeService {
Movie movie = movieRepository.findByTitle(title)
.orElseThrow(MovieTimeServiceImpl::throwMovieNotFound);
LocalDateTime startOfDay = runningDate.atStartOfDay();
// 영화 시작 시간이 다음날 06시 이전까지 모두 가져오기 위한 날짜
LocalDateTime endOfDay = startOfDay.plusHours(30);
// 영화 시작 시간이 06시 이전(전날 심야 영화)는 제외하고 가져오기
LocalDateTime startOfDay = runningDate.atStartOfDay().plusHours(6);
// 영화 시작 시간이 익일 06시 이전(심야 영화)까지 모두 가져오기
LocalDateTime endOfDay = startOfDay.plusDays(1);
List<MovieTime> movieTimes = movieTimeRepository.findValidMovieTimes(movie.getId(), startOfDay, endOfDay);