diff --git a/src/main/java/org/ntlab/tampoposerver/resources/UsersResource.java b/src/main/java/org/ntlab/tampoposerver/resources/UsersResource.java index 9e2a135..9ca3bba 100644 --- a/src/main/java/org/ntlab/tampoposerver/resources/UsersResource.java +++ b/src/main/java/org/ntlab/tampoposerver/resources/UsersResource.java @@ -70,7 +70,7 @@ //新規アカウントを作る @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED) - public Response createUser(@FormParam("user_id") String userId, @FormParam("password") String password) { + public Response createUser(@FormParam("user-id") String userId, @FormParam("password") String password) { //ユーザーがいるか調べる User user = userRepository.getUser(userId); @@ -91,9 +91,9 @@ //単一アカウントの情報を返す @GET - @Path("/{userId}") + @Path("/{user-id}") @Produces(MediaType.APPLICATION_JSON) - public Response getUser(@PathParam("userId") String userId) { + public Response getUser(@PathParam("user-id") String userId) { //取得 User user = userRepository.getUser(userId); //存在の確認 @@ -106,8 +106,8 @@ //ユーザの削除 ok @DELETE //deleteはquery parameter - @Path("/{userId}") - public Response deleteUser(@PathParam("userId") String userId, @QueryParam("token") String token) { + @Path("/{user-id}") + public Response deleteUser(@PathParam("user-id") String userId, @QueryParam("token") String token) { //取得 User user = userRepository.getUser(userId); //存在チェック @@ -135,9 +135,9 @@ //ログイン @POST - @Path("/{userId}/login") + @Path("/{user-id}/login") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) - public Response login(@PathParam("userId") String userId, @FormParam("password") String password) { + public Response login(@PathParam("user-id") String userId, @FormParam("password") String password) { //存在チェック User user = userRepository.getUser(userId); @@ -167,9 +167,9 @@ //アカウントのニックネームの取得 ok @GET - @Path("/{userId}/name") + @Path("/{user-id}/name") @Produces(MediaType.APPLICATION_JSON) - public Response getName(@PathParam("userId") String userId) { + public Response getName(@PathParam("user-id") String userId) { //取得 User user = userRepository.getUser(userId); //存在チェック @@ -184,9 +184,9 @@ //ニックネームの変更 @PUT - @Path("/{userId}") + @Path("/{user-id}") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) - public Response updateName(@PathParam("userId") String userId, @FormParam("new_name") String newName, @FormParam("token") String token) { + public Response updateName(@PathParam("user-id") String userId, @FormParam("new-name") String newName, @FormParam("token") String token) { User user = userRepository.getUser(userId); if (user == null) { @@ -213,9 +213,9 @@ //単一アカウントのパスワードの取得 ok @GET - @Path("/{userId}/password") + @Path("/{user-id}/password") @Produces(MediaType.APPLICATION_JSON) - public Response getPassword(@PathParam("userId") String userId, @QueryParam("token") String token) { + public Response getPassword(@PathParam("user-id") String userId, @QueryParam("token") String token) { User user = userRepository.getUser(userId); if (user == null) { throw new WebApplicationException(Response.Status.NOT_FOUND); @@ -225,9 +225,9 @@ //指定されたIDのパスワードを変更する @PUT - @Path("/{userId}/password") + @Path("/{user-id}/password") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) - public Response updatePassword(@PathParam("userId") String userId, @FormParam("new_password") String newPassword) { + public Response updatePassword(@PathParam("user-id") String userId, @FormParam("new-password") String newPassword) { User user = userRepository.getUser(userId); if (user == null) { @@ -248,9 +248,9 @@ //単一アカウントのemailの取得 @GET - @Path("/{userId}/email") + @Path("/{user-id}/email") @Produces(MediaType.APPLICATION_JSON) - public Response getEmail(@PathParam("userId") String userId) { + public Response getEmail(@PathParam("user-id") String userId) { User user = userRepository.getUser(userId); if (user == null) { throw new WebApplicationException(Response.Status.NOT_FOUND); @@ -260,9 +260,9 @@ //指定されたIDのemailを変更する @PUT - @Path("/{userId}/email") + @Path("/{user-id}/email") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) - public Response updateEmail(@PathParam("userId") String userId, @FormParam("new_email") String newEmail, @FormParam("token") String token) { + public Response updateEmail(@PathParam("user-id") String userId, @FormParam("new-email") String newEmail, @FormParam("token") String token) { User user = userRepository.getUser(userId); if (user == null) { @@ -289,9 +289,9 @@ //指定されたIDのアイコンを返す @GET - @Path("/{userId}/icon") + @Path("/{user-id}/icon") @Produces(MediaType.APPLICATION_JSON) - public Response getIcon(@PathParam("userId") String userId) { + public Response getIcon(@PathParam("user-id") String userId) { User user = userRepository.getUser(userId); if (user == null) { throw new WebApplicationException(Response.Status.NOT_FOUND); @@ -301,9 +301,9 @@ //アイコンを変更する @PUT - @Path("/{userId}/icon") + @Path("/{user-id}/icon") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) - public String updateIcon(@PathParam("userId") String userId, @FormParam("new_icon") String newIcon, @FormParam("token") String token) { + public String updateIcon(@PathParam("user-id") String userId, @FormParam("new-icon") String newIcon, @FormParam("token") String token) { User user = userRepository.getUser(userId); if (user == null) { @@ -330,9 +330,9 @@ //フレンド相手の情報の取得 @GET - @Path("/{userId}/friends/") + @Path("/{user-id}/friends/") @Produces(MediaType.APPLICATION_JSON) - public Response getFriends(@PathParam("userId") String userId, @QueryParam("token") String token) { + public Response getFriends(@PathParam("user-id") String userId, @QueryParam("token") String token) { User user = userRepository.getUser(userId); if (user == null) { throw new WebApplicationException( @@ -365,9 +365,9 @@ //自分のペアのpid一覧(JSON)の取得 @GET - @Path("/{userId}/friends/{pairId}") + @Path("/{user-id}/friends/{pair-id}") @Produces(MediaType.APPLICATION_JSON) - public Response getPairId(@PathParam("userId") String userId, @QueryParam("token") String token, @PathParam("pairId") String pairId) { + public Response getPairId(@PathParam("user-id") String userId, @QueryParam("token") String token, @PathParam("pair-id") String pairId) { User user = userRepository.getUser(userId); if (user == null) { throw new WebApplicationException( @@ -394,8 +394,8 @@ //ペアの削除  @DELETE - @Path("/{userId}/friends/{pairId}") - public Response deleteFriends(@PathParam("userId") String userId, @PathParam("pairId") int pairId, @QueryParam("token") String token) { + @Path("/{user-id}/friends/{pair-id}") + public Response deleteFriends(@PathParam("user-id") String userId, @PathParam("pair-id") int pairId, @QueryParam("token") String token) { User user = userRepository.getUser(userId); if (user == null) { throw new NotFoundException("IDが存在しません");