diff --git a/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java b/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java index e7d5617..c4bbb83 100644 --- a/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java +++ b/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java @@ -35,6 +35,7 @@ // account_idとpasswordを設定し新しいアカウントを作成する(POST) @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED)//bodyに入力する値がある時 + @Produces(MediaType.APPLICATION_JSON) public String signup(@FormParam("account_id") String accountId, @FormParam("password") String password) { String token; if (password == null) { @@ -86,6 +87,7 @@ //指定されたIDのパスワードを変更する (PUT) @Path("/{account_id}/password") @PUT + @Consumes(MediaType.APPLICATION_FORM_URLENCODED)//bodyに入力する値がある時 public void changePassword(@PathParam("account_id") String accountId, @FormParam("new_password")String newPassword, @FormParam("old_password")String oldPassword, @@ -117,6 +119,7 @@ // 指定されたIDの自己紹介を変更する (PUT) @Path("/{account_id}/introduction") @PUT + @Consumes(MediaType.APPLICATION_FORM_URLENCODED)//bodyに入力する値がある時 public void changeIntroduction(@PathParam("account_id") String accountId, @FormParam("introduction")String introduction, @FormParam("token") String token){ @@ -158,6 +161,8 @@ // アカウントidとパスワードでログインし、tokenを返す (POST) @Path("/{account_id}/login") @POST + @Produces(MediaType.APPLICATION_JSON) + @Consumes(MediaType.APPLICATION_FORM_URLENCODED)//bodyに入力する値がある時 public String login(@PathParam("account_id") String accountId,@FormParam("password") String password) { //404 if (!accountManager.getAccountsID().contains(accountId)){ //account_idが存在しない時