diff --git a/src/main/java/org/ntlab/citrusserver/repositories/AccountManager.java b/src/main/java/org/ntlab/citrusserver/repositories/AccountManager.java index e7291b8..d9ab9fd 100644 --- a/src/main/java/org/ntlab/citrusserver/repositories/AccountManager.java +++ b/src/main/java/org/ntlab/citrusserver/repositories/AccountManager.java @@ -1,4 +1,36 @@ package org.ntlab.citrusserver.repositories; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.MediaType; +import org.ntlab.citrusserver.entities.Account; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Repository; + +import java.lang.reflect.Array; +import java.util.*; + +import java.util.HashMap; + +@Repository public class AccountManager { + private HashMap accounts = new HashMap(); + + private HashMap accountToken = new HashMap<>(); //keyがaccountId,valueがtoken + + public Set getAccounts() { + return accounts.keySet(); + } + + public String setAccount(String accountId, String password) { + UUID str = UUID.randomUUID(); + String token = str.toString(); + accounts.setId(accountId); + accounts.setPassword(password); + accountToken.put(accountId, token); + return token; + } + + public Account getAccountInfo(String accountId) { + return accounts.get(accountId); + } }