diff --git a/src/main/java/org/ntlab/acanthus_server/entities/FollowJson.java b/src/main/java/org/ntlab/acanthus_server/entities/FollowJson.java new file mode 100644 index 0000000..71ebd81 --- /dev/null +++ b/src/main/java/org/ntlab/acanthus_server/entities/FollowJson.java @@ -0,0 +1,25 @@ +package org.ntlab.acanthus_server.entities; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.HashMap; + +public class FollowJson { + @JsonProperty("follows") + private HashMap follows = new HashMap<>(); + + //Json型でフォローしているユーザーIDを表示する処理 + public FollowJson(HashMap followsHashMap){ + for (var follow : followsHashMap.values()){ + follows.put(follow.getUid(), follow.getName()); + } + } + + public HashMap getFollows() { + return follows; + } + + public void setFollows(HashMap follows) { + this.follows = follows; + } +}