package br.ufg.inf.adopet.model;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by rony on 24/11/16.
 */

public class Post {

    private int id;
    private String title;
    private String author;
    private String description;
    private String[] images;
    private String shareLink;
    private int interested;

    public Post(int id, String title, String author, String description, String[] images, String shareLink, int interested) {
        this.id = id;
        this.title = title;
        this.author = author;
        this.description = description;
        this.images = images;
        this.shareLink = shareLink;
        this.interested = interested;
    }

    public int getId() {
        return id;
    }

    public String getTitle() {
        return title;
    }

    public String getDescription() {
        return description;
    }

    public String[] getImages() {
        return images;
    }

    public String getShareLink() {
        return shareLink;
    }

    public int getInterested() {
        return interested;
    }

    public String getAuthor(){
        return author;
    }

    public String toJSON() throws JSONException {
        JSONObject json = new JSONObject();
        json.put("id",this.id);
        json.put("title",this.title);
        json.put("description",this.description);
        //json.put("images","");
        json.put("share_link",this.shareLink);
        json.put("interested",this.interested);

        return json.toString();
    }
}

@@ -299,25 +299,22 @@
 e String
-%5B%5D
  image
-s
 ;%0A    pr
@@ -430,70 +430,13 @@
 ing 
-description, String%5B%5D images, String shareLink, int interested
+image
 ) %7B%0A
@@ -519,48 +519,8 @@
 or;%0A
-        this.description = description;%0A
     
@@ -537,17 +537,16 @@
 mage
-s
  = image
 s;%0A 
@@ -545,83 +545,8 @@
 mage
-s;%0A        this.shareLink = shareLink;%0A        this.interested = interested
 ;%0A  
@@ -754,10 +754,8 @@
 ring
-%5B%5D
  get
@@ -759,17 +759,16 @@
 getImage
-s
 () %7B%0A   
@@ -784,17 +784,16 @@
 rn image
-s
 ;%0A    %7D%0A

update model for publish post