diff --git a/app/src/main/java/com/example/nemophila/entities/Post.java b/app/src/main/java/com/example/nemophila/entities/Post.java index b97d9be..5c65deb 100644 --- a/app/src/main/java/com/example/nemophila/entities/Post.java +++ b/app/src/main/java/com/example/nemophila/entities/Post.java @@ -55,8 +55,14 @@ this.comment = comment; } -// public Post(PostJson pj) { -// this.pid = pj.getId(); -// this.uid = pj.getOwner() -// } + //コンストラクタ(PostJsonからPostを作成) + public Post(PostJson pj) { + this.pid = pj.getId(); + this.uid = pj.getOwner().getId(); + this.name = pj.getOwner().getName(); + this.genre = this.getGenre(); + this.date = "2001/12/12"; //サンプル + this.rate = pj.getRate(); + this.comment = pj.getComment(); + } }