diff --git a/src/main/java/org/ntlab/acanthus_server/entities/Account.java b/src/main/java/org/ntlab/acanthus_server/entities/Account.java index cb48a1e..1201294 100644 --- a/src/main/java/org/ntlab/acanthus_server/entities/Account.java +++ b/src/main/java/org/ntlab/acanthus_server/entities/Account.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.ArrayList; +import java.util.HashMap; import java.util.UUID; public class Account { @@ -30,7 +31,7 @@ private Integer uid; private String name; private String email; - private ArrayList workList = new ArrayList<>(); + private HashMap workHashMap = new HashMap<>(); @JsonIgnore private String token; @@ -66,7 +67,8 @@ } public void addWork(Work work) { - this.workList.add(work); + //var aid = work.getAid(); + //this.workList.push(work); } //----------------------------------------------------------------- @@ -96,22 +98,24 @@ public ArrayList getInvitedList() { var invitedList = new ArrayList(); - for (var work : workList){ + for (var work : workHashMap.values()) { if (work.isInviting()) invitedList.add(work); } return invitedList; } + //----------------------------------------------------------------- // 参加している作品を返す public ArrayList getWorkingList() { var workingList = new ArrayList(); - for (var work : workList) { + for (var work : workHashMap.values()) { if (work.isWorking()) workingList.add(work); } - return workingList; + return workingList; } + //----------------------------------------------------------------- //----------------------------------------------------------------- // トークンを更新する 藤井