feat: register movie time API

This commit is contained in:
손창현
2022-07-15 02:37:30 +09:00
parent 12a23667b6
commit fb5c34b520
3 changed files with 5 additions and 4 deletions

View File

@@ -46,8 +46,10 @@ public class MovieTimeController {
movieTimeRegisterRequest.toMovieTimeRegisterDTO()
);
return ResponseEntity.status(HttpStatus.OK)
.body(
registeredMovieTimeDto.toResponse()
);
}
@GetMapping

View File

@@ -20,7 +20,6 @@ public class MovieTimeRegisterRequest {
@NotNull(message = "{validation.not.null.round}")
private Integer round;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Seoul")
private LocalDateTime startAt;
public MovieTimeRegisterDTO toMovieTimeRegisterDTO() {

View File

@@ -38,7 +38,7 @@ public class MovieTimeServiceImpl implements MovieTimeService {
public RegisteredMovieTimeDTO registerMovieTime(@Valid MovieTimeRegisterDTO movieTimeRegisterDto) {
Movie movie = findMovieById(movieTimeRegisterDto.getMovieId());
Theater theater = findTheaterByNumber(movieTimeRegisterDto.getTheaterNumber());
int round = movieTimeRegisterDto.getTheaterNumber();
int round = movieTimeRegisterDto.getRound();
Optional<MovieTime> movieTime =
movieTimeRepository.findByMovieAndTheaterAndRoundAndDeletedAtNull(movie, theater, round);