diff --git a/src/main/java/org/ntlab/nemophila/models/accounts/Account.java b/src/main/java/org/ntlab/nemophila/models/accounts/Account.java index 87235e2..cc51cc5 100644 --- a/src/main/java/org/ntlab/nemophila/models/accounts/Account.java +++ b/src/main/java/org/ntlab/nemophila/models/accounts/Account.java @@ -61,17 +61,14 @@ //新規投稿 public Post createPost(String sid, int rate, String genre, String comment, String image1, String image2, String image3) { - Post post = new Post(); - - post.setId(sid); - post.setRate(rate); - post.setGenre(genre); - //コメントと写真は必須ではない。nullで登録できる??? - //無理ならnull時「なし」に変換させて登録で。 - post.setComment(comment); + Post post = new Post(this, genre, rate, sid); + //pidの登録 + post.setId(String.valueOf(posts.size()+1)); + //null時「なし」に変換させて登録。 post.setImage1(image1); post.setImage2(image2); post.setImage3(image3); + post.setComment(comment); posts.put(post.getId(), post);