diff --git a/src/main/java/org/ntlab/citrusserver/resources/BooksRest.java b/src/main/java/org/ntlab/citrusserver/resources/BooksRest.java index 3132746..67d3ee1 100644 --- a/src/main/java/org/ntlab/citrusserver/resources/BooksRest.java +++ b/src/main/java/org/ntlab/citrusserver/resources/BooksRest.java @@ -29,15 +29,15 @@ @Path("/{account_id}/books") @GET @Produces(MediaType.APPLICATION_JSON) - public HashMap getBooks(@PathParam("account_id") String account_id){ - return bookManager.getBooks(account_id); + public HashMap getBooks(@PathParam("account_id") String account_id, String token){ + return bookManager.getBooks(account_id, token); } @Path("/{account_id}/books") @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED)//bodyに入力する値がある時 - public int createBook(@PathParam("account_id") String account_id, @FormParam("title") String title, @FormParam("color") String color, @FormParam("publicity") Boolean publicity) { - return bookManager.createBook(account_id, title, color, publicity); + public int createBook(@PathParam("account_id") String account_id, @FormParam("title") String title, @FormParam("color") String color, @FormParam("publicity") Boolean publicity, String token) { + return bookManager.createBook(account_id, title, color, publicity, token); } @@ -46,15 +46,15 @@ @Path("/{account_id}/books/{book_id}") @GET @Produces(MediaType.APPLICATION_JSON) - public Book getBook(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id){ - return bookManager.getBook(account_id, book_id); + public Book getBook(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id, String token){ + return bookManager.getBook(account_id, book_id, token); } /// 本の削除 @Path("/{account_id}/books/{book_id}") @DELETE @Consumes(MediaType.APPLICATION_FORM_URLENCODED) - public void deleteTodoById(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id){ - bookManager.deleteBook(account_id, book_id); + public void deleteTodoById(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id, String token){ + bookManager.deleteBook(account_id, book_id, token); } /// /{account_id}/books/{book_id}/title @@ -62,16 +62,16 @@ @Path("/{account_id}/books/{book_id}/title") @GET @Produces(MediaType.TEXT_PLAIN) - public String getTitle(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id){ - return bookManager.getTitle(account_id, book_id); + public String getTitle(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id, String token){ + return bookManager.getTitle(account_id, book_id, token); } /// 本のタイトル変更 @Path("/{account_id}/books/{book_id}/title") @PUT @Consumes(MediaType.APPLICATION_FORM_URLENCODED) - public void putTitle(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id, @FormParam("title") String title){ - bookManager.putTitle(account_id, book_id, title); + public void putTitle(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id, @FormParam("title") String title, String token){ + bookManager.putTitle(account_id, book_id, title, token); } /// /accounts/{account_id}/books/{book_id}/public @@ -79,16 +79,16 @@ @Path("/{account_id}/books/{book_id}/public") @GET @Produces(MediaType.TEXT_PLAIN) - public Boolean getPublicity(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id){ - return bookManager.getPublicity(account_id, book_id); + public Boolean getPublicity(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id, String token){ + return bookManager.getPublicity(account_id, book_id, token); } /// 公開情報を変更する @Path("/{account_id}/books/{book_id}/public") @PUT @Consumes(MediaType.APPLICATION_FORM_URLENCODED) - public void putPublicity(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id, @FormParam("publicity") Boolean publicity){ - bookManager.putPublicity(account_id, book_id, publicity); + public void putPublicity(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id, @FormParam("publicity") Boolean publicity, String token){ + bookManager.putPublicity(account_id, book_id, publicity, token); } /// /accounts/{account_id}/books/{book_id}/color @@ -96,7 +96,7 @@ @Path("/{account_id}/books/{book_id}/color") @PUT @Consumes(MediaType.APPLICATION_FORM_URLENCODED) - public void putColor(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id, @FormParam("color") String color){ - bookManager.putColor(account_id, book_id, color); + public void putColor(@PathParam("account_id") String account_id, @PathParam("book_id") Integer book_id, @FormParam("color") String color, String token){ + bookManager.putColor(account_id, book_id, color, token); } } \ No newline at end of file