forked from hanghae-skillup/redis_1st
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReservationController.java
More file actions
25 lines (21 loc) · 1012 Bytes
/
ReservationController.java
File metadata and controls
25 lines (21 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package org.example.controller;
import lombok.RequiredArgsConstructor;
import org.example.baseresponse.BaseResponse;
import org.example.baseresponse.BaseResponseStatus;
import org.example.dto.request.ReservationRequestDto;
import org.example.service.reservation.ReservationService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import static org.example.baseresponse.BaseResponseStatus.SUCCESS;
@RestController
@RequiredArgsConstructor
public class ReservationController {
private final ReservationService reservationService;
@PostMapping("/reservation")
public BaseResponse<BaseResponseStatus> getPlayingMovies(@RequestBody @Validated ReservationRequestDto reservationRequestDto) {
reservationService.reserveMovie(reservationRequestDto);
return new BaseResponse<>(SUCCESS);
}
}