diff --git a/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java b/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java index 35a2503..f5943c7 100644 --- a/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java +++ b/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java @@ -41,7 +41,7 @@ @Path("/{account_id}") @GET @Produces(MediaType.APPLICATION_JSON) - public Account getAccountInfo(@PathParam("account_id") String accountId){ //account_idを渡してManegerから値が返ってくる + public Account getAccountInfo(@PathParam("account_id") String accountId){ Account ac = accountManager.getAccount(accountId); return ac; } @@ -52,7 +52,7 @@ public void deleteAccount(@PathParam("account_id") String accountId, @QueryParam("token") String token, @QueryParam("password")String password) { - accountManager.deleteAccount(accountId, password, token); + accountManager.deleteAccount(accountId, token, password); } @@ -60,10 +60,10 @@ @Path("/{account_id}/password") @PUT public void changePassword(@PathParam("account_id") String accountId, - @QueryParam("token") String token, + @FormParam("new_password")String newPassword, @FormParam("old_password")String oldPassword, - @FormParam("new_password")String newPassword){ - accountManager.changePassword(accountId,token,oldPassword,newPassword); + @QueryParam("token") String token){ + accountManager.changePassword(accountId,newPassword,oldPassword,token); } // 指定されたIDの自己紹介を返す(GET) @@ -79,9 +79,9 @@ @Path("/accounts/{account_id}/introduction") @PUT public void changeIntroduction(@PathParam("account_id") String accountId, - @FormParam("token") String token, - @FormParam("introduction")String introduction){ - accountManager.changeIntroduction(accountId,token,introduction); + @FormParam("introduction")String introduction, + @FormParam("token") String token){ + accountManager.changeIntroduction(accountId,introduction,token); } ///////// // @Path("/accounts/{account_id}/photo") @@ -91,7 +91,7 @@ // Account ac = accountManager.getAccount(accountId); // return ac.getPhoto(); // } -// +// @Path("/accounts/{account_id}/photo") // @PUT @@ -107,7 +107,9 @@ @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){ //account_idを渡してManegerから値が返ってくる + public ArrayList FavoriteBook(@PathParam("account_id") String accountId, + @PathParam("other_account_id") String otherAccountId, + @QueryParam("token")String token){ return accountManager.FavoritesBookId(accountId,otherAccountId,token); } @@ -123,12 +125,11 @@ -//////// + // アカウントidとパスワードでログインし、tokenを返す (POST) -// @Path("/accounts/{account_id}/login") -// @POST -// @Consumes(MediaType.APPLICATION_JSON) -// public void login(@PathParam("account_id") String accountId,@FormParam("password") String password) { -// accountManager.put(accountId, password); -// } + @Path("/accounts/{account_id}/login") + @POST + public void login(@PathParam("account_id") String accountId,@FormParam("password") String password) { + accountManager.login(accountId, password); + } }