diff --git a/src/main/java/org/ntlab/citrusserver/resources/TodoRest.java b/src/main/java/org/ntlab/citrusserver/resources/TodoRest.java index 5990081..ffea96d 100644 --- a/src/main/java/org/ntlab/citrusserver/resources/TodoRest.java +++ b/src/main/java/org/ntlab/citrusserver/resources/TodoRest.java @@ -45,7 +45,7 @@ @Path("/accounts/{account_id}/books/{book_id}/todos/{year}/{month}") @GET @Produces(MediaType.APPLICATION_JSON) - public HashMap getTodoMonth(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id, @PathParam("year") Integer year, @PathParam("month") Integer month, @QueryParam("token") String token) { + public HashMap> getTodoMonth(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id, @PathParam("year") Integer year, @PathParam("month") Integer month, @QueryParam("token") String token) { return todoManager.getTodosByMonth(account_id, book_id, year, month,token); } @@ -81,13 +81,18 @@ @PUT @Path("/accounts/{account_id}/books/{book_id}/todos/{year}/{month}/{day}/{todo_id}/check") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) - public void putTodo(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id, @PathParam("year") Integer year, @PathParam("month") Integer month, @PathParam("day") Integer day,@PathParam("todo_id") Integer todo_id, @FormParam("check") boolean check, @QueryParam("token") String token){ + public void setCheck(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id, @PathParam("year") Integer year, @PathParam("month") Integer month, @PathParam("day") Integer day,@PathParam("todo_id") Integer todo_id, @FormParam("check") boolean check, @QueryParam("token") String token){ todoManager.setCheck(account_id, book_id, year, month, day, todo_id,check,token); } //delete追加必要 - - + //本のtodoを年月日とtodo_idを指定してそのtodoを削除する + @DELETE + @Path("/accounts/{account_id}/books/{book_id}/todos/{year}/{month}/{day}/{todo_id}") + @Consumes(MediaType.APPLICATION_FORM_URLENCODED) + public void deleteTodoById(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id, @PathParam("year") Integer year, @PathParam("month") Integer month, @PathParam("day") Integer day, @PathParam("todo_id") Integer todo_id, @QueryParam("token") String token){ + todoManager.deleteTodoById(account_id, book_id, year, month, day, todo_id,token); + }