diff --git a/src/main/java/org/ntlab/citrusserver/repositories/AccountManager.java b/src/main/java/org/ntlab/citrusserver/repositories/AccountManager.java index d9ab9fd..9efa708 100644 --- a/src/main/java/org/ntlab/citrusserver/repositories/AccountManager.java +++ b/src/main/java/org/ntlab/citrusserver/repositories/AccountManager.java @@ -17,20 +17,23 @@ private HashMap accountToken = new HashMap<>(); //keyがaccountId,valueがtoken - public Set getAccounts() { + // アカウントの一覧をリストとして返す + public Set getAccountsID() { return accounts.keySet(); } - public String setAccount(String accountId, String password) { + // account_idとpasswordを設定し新しいアカウントを作成する + public String newAccount(String accountId, String password) { UUID str = UUID.randomUUID(); String token = str.toString(); - accounts.setId(accountId); - accounts.setPassword(password); - accountToken.put(accountId, token); + //accounts.setId(accountId); + //accounts.setPassword(password); + accountToken.put(accountId, token); //accountIDとtokenをHashMapに入れる return token; } - public Account getAccountInfo(String accountId) { + // 指定されたアカウントの情報を返す + public Account getAccount(String accountId) { return accounts.get(accountId); } }