diff --git a/src/main/java/org/ntlab/acanthus_server/entities/FollowJson.java b/src/main/java/org/ntlab/acanthus_server/entities/FollowJson.java index 71ebd81..a29b209 100644 --- a/src/main/java/org/ntlab/acanthus_server/entities/FollowJson.java +++ b/src/main/java/org/ntlab/acanthus_server/entities/FollowJson.java @@ -2,24 +2,36 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; import java.util.HashMap; public class FollowJson { - @JsonProperty("follows") - private HashMap follows = new HashMap<>(); + @JsonProperty("followUids") + private ArrayList followUids = new ArrayList<>(); + @JsonProperty("followNames") + private ArrayList followNames = new ArrayList<>(); //Json型でフォローしているユーザーIDを表示する処理 public FollowJson(HashMap followsHashMap){ for (var follow : followsHashMap.values()){ - follows.put(follow.getUid(), follow.getName()); + followUids.add(follow.getUid()); + followNames.add(follow.getName()); } } - public HashMap getFollows() { - return follows; + public ArrayList getFollowUids() { + return followUids; } - public void setFollows(HashMap follows) { - this.follows = follows; + public ArrayList getFollowNames() { + return followNames; + } + + public void setFollowUids(ArrayList followUids) { + this.followUids = followUids; + } + + public void setFollowNames(ArrayList followNames) { + this.followNames = followNames; } }