diff --git a/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java b/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java index f1ae5e7..a305d5a 100644 --- a/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java +++ b/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java @@ -157,45 +157,6 @@ // @Path("/{account_id}/photo") // @PUT - - //指定されたIDのお気に入りの本のリストを返す - @Path("/accounts/{account_id}/favorites") - @GET - @Produces(MediaType.APPLICATION_JSON) - public ArrayList> favoriteBook(@PathParam("account_id") String accountId, - @QueryParam("token")String token){ - if(accountManager.checkToken(accountId, token)) { - return accountManager.Favorites(accountId, token); - } - //404 - if (!accountManager.getAccountsID().contains(accountId)){ //account_idが存在しない時 - var response = Response.status(Response.Status.NOT_FOUND).entity("IDが存在しません");//404 - throw new WebApplicationException(response.build()); - } - return null; - } - - //指定されたIDのお気に入りの本のリストを返す(指定した人物) - @Path("/accounts/{account_id}/favorites/{other_account_id}") - @GET - @Produces(MediaType.APPLICATION_JSON) - public ArrayList FavoriteBook(@PathParam("account_id") String accountId, - @PathParam("other_account_id") String otherAccountId, - @QueryParam("token")String token){ - if(accountManager.checkToken(accountId, token)) { - return accountManager.FavoritesBookId(accountId, otherAccountId, token); - } - - //404 - if (!accountManager.getAccountsID().contains(accountId)){ //account_idが存在しない時 - var response = Response.status(Response.Status.NOT_FOUND).entity("IDが存在しません");//404 - throw new WebApplicationException(response.build()); - } - //403 - var response = Response.status(Response.Status.FORBIDDEN).entity("認証失敗");//forbiddenは403 - throw new WebApplicationException(response.build()); - } - ////////// // お気に入りの本のbook_idを削除する (DELETE) // @Path("/{account_id}/favorites/{other_account_id}/{book_id}")