Skip to content

Commit d54dbec

Browse files
authored
고생하셨습니다.
🎉 PR 머지 완료! 🎉
1 parent 6d1f52c commit d54dbec

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/main/java/roomescape/controller/ReservationController.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package roomescape.controller;
22

3-
import org.springframework.beans.factory.annotation.Autowired;
43
import org.springframework.http.HttpStatus;
54
import org.springframework.http.ResponseEntity;
6-
import org.springframework.jdbc.core.JdbcTemplate;
75
import org.springframework.stereotype.Controller;
86
import org.springframework.web.bind.annotation.*;
97
import roomescape.model.Reservation;
@@ -21,9 +19,6 @@ public ReservationController(ReservationService reservationService) {
2119
this.reservationService = reservationService;
2220
}
2321

24-
@Autowired
25-
private JdbcTemplate jdbcTemplate;
26-
2722
@GetMapping("/reservation")
2823
public String reservationPage() {
2924
return "reservation";

src/main/java/roomescape/exception/GlobalExceptionHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
import org.springframework.http.ResponseEntity;
55
import org.springframework.web.bind.annotation.ControllerAdvice;
66
import org.springframework.web.bind.annotation.ExceptionHandler;
7+
import roomescape.controller.ReservationController;
78

8-
@ControllerAdvice
9+
@ControllerAdvice(assignableTypes = ReservationController.class)
910
public class GlobalExceptionHandler {
1011

1112
@ExceptionHandler({NotFoundReservationException.class, InvalidReservationParameterException.class, IllegalArgumentException.class})
1213
public ResponseEntity<String> handleIllegalArgumentException(RuntimeException exception) {
13-
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
14+
return ResponseEntity.status(HttpStatus.BAD_REQUEST) // status: 400
1415
.body(exception.getMessage());
1516
}
1617
}

0 commit comments

Comments
 (0)