From bd591cd3dd9601b68596e1eaf7c001fcb0f70df8 Mon Sep 17 00:00:00 2001 From: cyzlcyzl Date: Sat, 16 Dec 2023 21:46:47 +0900 Subject: [PATCH] feat(TODO): edit parameter type of todo/check method Long -> Map #38 --- .../java/mvc/promiseme/todo/controller/TodoController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/mvc/promiseme/todo/controller/TodoController.java b/src/main/java/mvc/promiseme/todo/controller/TodoController.java index ea88fc0..c7e1204 100644 --- a/src/main/java/mvc/promiseme/todo/controller/TodoController.java +++ b/src/main/java/mvc/promiseme/todo/controller/TodoController.java @@ -11,6 +11,7 @@ import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.List; +import java.util.Map; @Slf4j @RestController @@ -36,7 +37,9 @@ public ResponseEntity editTodo(@RequestBody TodoRequestDTO todoRequestDT } @PostMapping("/check") - public ResponseEntity checkTodo(@RequestBody Long todoId){ + public ResponseEntity checkTodo(@RequestBody Map requestBody){ + Integer tmp = (Integer) requestBody.get("todoId"); + Long todoId = Long.valueOf(tmp); return ResponseEntity.ok(todoService.check(todoId)); } }