| |
---|
| | } |
---|
| | |
---|
| | // account_idとpasswordを設定し新しいアカウントを作成する(POST) |
---|
| | public String createAccount(String accountId, String password) { |
---|
| | UUID str = UUID.randomUUID(); |
---|
| | String token = str.toString(); |
---|
| | Account account = new Account(accountId, password); |
---|
| | if(!accounts.containsKey(accountId)) { |
---|
| | UUID str = UUID.randomUUID(); |
---|
| | String token = str.toString(); |
---|
| | Account account = new Account(accountId, password); |
---|
| | accounts.put(accountId, account); |
---|
| | accountToken.put(accountId, token); //accountIDとtokenをHashMapに入れる |
---|
| | return token; |
---|
| | } else { |
---|
| | return null; |
---|
| | } |
---|
| | return token; |
---|
| | } |
---|
| | |
---|
| | //accountIdとtokenを比較してtrueかfalseを返す |
---|
| | public boolean checkToken(String accountId, String token) { |
---|
| |
---|
| | |