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 1b17fd1..7be6334 100644 --- a/src/main/java/org/ntlab/acanthus_server/entities/Account.java +++ b/src/main/java/org/ntlab/acanthus_server/entities/Account.java @@ -46,6 +46,13 @@ @JsonProperty("work") private HashMap workHashMap = new HashMap<>(); + //@JsonProperty("follows") + @JsonIgnore //アカウント情報取得時のループ対策 + private HashMap followsHashMap = new HashMap<>(); + //@JsonProperty("followers") + @JsonIgnore + private HashMap followersHashMap =new HashMap<>(); + @JsonIgnore private Integer uid; @JsonIgnore @@ -97,6 +104,16 @@ this.workHashMap.put(aid, work); } + public void addFollowsHashMap(Account account) { + var uid = account.getUid(); + this.followsHashMap.put(uid, account); + } + + public void addFollowersHashMap(Account account) { + var uid = account.getUid(); + this.followersHashMap.put(uid, account); + } + //----------------------------------------------------------------- // getter public Integer getUid() { @@ -124,6 +141,14 @@ return this.workHashMap; } + public HashMap getFollowsHashMap() { + return this.followsHashMap; + } + + public HashMap getFollowersHashMap() { + return this.followersHashMap; + } + //----------------------------------------------------------------- // 招待されている作品を返す @JsonIgnore