diff --git a/src/main/java/org/ntlab/nemophila/models/shops/Shop.java b/src/main/java/org/ntlab/nemophila/models/shops/Shop.java index 59368ca..3559e50 100644 --- a/src/main/java/org/ntlab/nemophila/models/shops/Shop.java +++ b/src/main/java/org/ntlab/nemophila/models/shops/Shop.java @@ -13,7 +13,7 @@ private double longitude; @JsonProperty("latitude") private double latitude; - @JsonProperty("posts") + private ArrayList posts = new ArrayList<>(); //Getter @@ -29,19 +29,23 @@ public double getLatitude() { return latitude; } + //idからその店の投稿を返す + public ArrayList getPosts() { + return posts; + } //Setter public void setId(String id) { - id = id; + this.id = id; } public void setName(String name) { - name = name; + this.name = name; } public void setLongitude(double longitude) { - longitude = longitude; + this.longitude = longitude; } - public void setLatitude(double latitude) { - latitude = latitude; + public void setLatitude(double latitude) { + this.latitude = latitude; } //postsに関するメソッド @@ -51,9 +55,6 @@ public void deletePost(Post post) { posts.remove(post); } - public Post getposts(int index) { - return posts.get(index); - } public int getPostsCount() { return posts.size(); }