diff --git a/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java b/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java index 9a6e657..1c958b8 100644 --- a/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java +++ b/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java @@ -5,7 +5,7 @@ import org.ntlab.citrusserver.entities.Account; import org.ntlab.citrusserver.repositories.AccountManager; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; +//import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import java.util.ArrayList; @@ -50,10 +50,8 @@ var response = Response.status(Response.Status.NOT_FOUND).entity("IDが存在しません");//404 throw new WebApplicationException(response.build()); } - Account ac = accountManager.getAccount(accountId); return ac; - } // アカウント情報を全削除する(DELETE) @@ -143,11 +141,11 @@ @Produces(MediaType.APPLICATION_JSON) public ArrayList> favoriteBook(@PathParam("account_id") String accountId, @QueryParam("token")String token){ - if(accountManager.checkToken(accountId, token) == true) { + if(accountManager.checkToken(accountId, token)) { return accountManager.Favorites(accountId, token); } //404 - if (accountManager.getAccountsID().contains(accountId) == false){ //account_idが存在しない時 + if (!accountManager.getAccountsID().contains(accountId)){ //account_idが存在しない時 var response = Response.status(Response.Status.NOT_FOUND).entity("IDが存在しません");//404 throw new WebApplicationException(response.build()); } @@ -161,12 +159,12 @@ public ArrayList FavoriteBook(@PathParam("account_id") String accountId, @PathParam("other_account_id") String otherAccountId, @QueryParam("token")String token){ - if(accountManager.checkToken(accountId, token) == true) { + if(accountManager.checkToken(accountId, token)) { return accountManager.FavoritesBookId(accountId, otherAccountId, token); } //404 - if (accountManager.getAccountsID().contains(accountId) == false){ //account_idが存在しない時 + if (!accountManager.getAccountsID().contains(accountId)){ //account_idが存在しない時 var response = Response.status(Response.Status.NOT_FOUND).entity("IDが存在しません");//404 throw new WebApplicationException(response.build()); } @@ -191,7 +189,7 @@ @POST public String login(@PathParam("account_id") String accountId,@FormParam("password") String password) { //404 - if (accountManager.getAccountsID().contains(accountId) == false){ //account_idが存在しない時 + if (!accountManager.getAccountsID().contains(accountId)){ //account_idが存在しない時 var response = Response.status(Response.Status.NOT_FOUND).entity("IDが存在しません");//404 throw new WebApplicationException(response.build()); }