File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/main/java/roomescape/controller Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 77import org .springframework .jdbc .support .GeneratedKeyHolder ;
88import org .springframework .jdbc .support .KeyHolder ;
99import org .springframework .stereotype .Controller ;
10- import org .springframework .web .bind .annotation .GetMapping ;
11- import org .springframework .web .bind .annotation .PostMapping ;
12- import org .springframework .web .bind .annotation .RequestBody ;
13- import org .springframework .web .bind .annotation .ResponseBody ;
10+ import org .springframework .web .bind .annotation .*;
1411import roomescape .model .time .Time ;
1512import roomescape .model .time .TimeRequest ;
1613
@@ -26,6 +23,7 @@ public class TimeController {
2623 public TimeController (JdbcTemplate jdbcTemplate ) {
2724 this .jdbcTemplate = jdbcTemplate ;
2825 }
26+
2927 @ GetMapping ("/times" )
3028 @ ResponseBody
3129 public List <Time > getTimes () {
@@ -63,4 +61,10 @@ public ResponseEntity<Time> createTimes(@RequestBody TimeRequest timeRequest) {
6361 .header ("Location" , "/times/" + time .getId ())
6462 .body (time );
6563 }
64+
65+ @ DeleteMapping ("/times/{id}" )
66+ public ResponseEntity <Void > deleteTime (@ PathVariable Long id ) {
67+ String sql = "DELETE FROM time WHERE id = ?" ;
68+ return ResponseEntity .noContent ().build ();
69+ }
6670}
You can’t perform that action at this time.
0 commit comments