| | package org.ntlab.nemophila.models.accounts; |
---|
| | |
---|
| | import org.ntlab.nemophila.models.shops.Shop; |
---|
| | import org.ntlab.nemophila.models.shops.ShopManager; |
---|
| | |
---|
| | import java.util.HashMap; |
---|
| | import java.util.UUID; |
---|
| | |
---|
| |
---|
| | private HashMap<String,Account> accountsMap = new HashMap<>(); |
---|
| | private int newId = 1111; |
---|
| | |
---|
| | private AccountManager() { |
---|
| | //ダミーアカウントとの作成 |
---|
| | //ダミーのお店を作成 |
---|
| | ShopManager sm = ShopManager.getInstance(); |
---|
| | Shop shopA = sm.createShop("店A", 12.3, 34.5); |
---|
| | Shop shopB = sm.createShop("店B", 56.7, 78.9); |
---|
| | Shop shopC = sm.createShop("店C", 12.3, 34.5); |
---|
| | Shop shopD = sm.createShop("店D", 56.7, 78.9); |
---|
| | |
---|
| | //ダミーアカウントの作成 |
---|
| | this.createAccount("a","a"); |
---|
| | Account testAc1 = this.getAccount("1111"); |
---|
| | testAc1.createPost(shopA, 5, "ラーメン", "おいしかった", null, null, null); |
---|
| | |
---|
| | this.createAccount("b","b"); |
---|
| | Account testAc2 = this.getAccount("1112"); |
---|
| | testAc2.createPost(shopB, 2, "そば", "濃かった", null, null, null); |
---|
| | |
---|
| | this.createAccount("c","c"); |
---|
| | Account testAc3 = this.getAccount("1113"); |
---|
| | testAc3.createPost(shopC, 3, "中華", "王将の方がおいしい", null, null, null); |
---|
| | |
---|
| | this.createAccount("d","d"); |
---|
| | Account testAc4 = this.getAccount("1114"); |
---|
| | testAc4.createPost(shopD, 5, "カレー", "なかなかおいしかった", null, null, null); |
---|
| | } |
---|
| | |
---|
| | //シングルトン化 |
---|
| | public static AccountManager getInstance() { |
---|
| | if(theInstance == null){ |
---|
| | theInstance = new AccountManager(); |
---|
| | } |
---|
| | return theInstance; |
---|
| | } |
---|
| | |
---|
| | // //全てのアカウントの取得 |
---|
| | //全てのアカウントの取得 |
---|
| | public HashMap<String, Account> getAccountsMap() { |
---|
| | return accountsMap; |
---|
| | } |
---|
| | |
---|
| |
---|
| | |
お願いします
DummyPost
3036fe7
intomaster
fromdummyPost
on 25 May 2023dummyPost
branch on 25 May 2023