package com.riversoft.weixin.common.media;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.riversoft.weixin.common.util.BooleanDeserializer;
import com.riversoft.weixin.common.util.BooleanSerializer;

import java.io.Serializable;

/**
 * Created by exizhai on 9/25/2015.
 */
public class MpArticle implements Serializable {

    private String title;
    private String author;
    private String content;
    private String digest;

    @JsonProperty("thumb_media_id")
    private String thumbMediaId;

    @JsonProperty("content_source_url")
    private String contentSourceUrl;

    @JsonSerialize(using = BooleanSerializer.class)
    @JsonDeserialize(using = BooleanDeserializer.class)
    @JsonProperty("show_cover_pic")
    private boolean showCover;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getDigest() {
        return digest;
    }

    public void setDigest(String digest) {
        this.digest = digest;
    }

    public String getThumbMediaId() {
        return thumbMediaId;
    }

    public void setThumbMediaId(String thumbMediaId) {
        this.thumbMediaId = thumbMediaId;
    }

    public String getContentSourceUrl() {
        return contentSourceUrl;
    }

    public void setContentSourceUrl(String contentSourceUrl) {
        this.contentSourceUrl = contentSourceUrl;
    }

    public boolean isShowCover() {
        return showCover;
    }

    public void setShowCover(boolean showCover) {
        this.showCover = showCover;
    }

    public MpArticle title(String title) {
        this.title = title;
        return this;
    }

    public MpArticle author(String author) {
        this.author = author;
        return this;
    }

    public MpArticle content(String content) {
        this.content = content;
        return this;
    }

    public MpArticle digest(String digest) {
        this.digest = digest;
        return this;
    }

    public MpArticle thumbMediaId(String thumbMediaId) {
        this.thumbMediaId = thumbMediaId;
        return this;
    }

    public MpArticle contentSourceUrl(String contentSourceUrl) {
        this.contentSourceUrl = contentSourceUrl;
        return this;
    }

    public MpArticle showCover() {
        this.showCover = true;
        return this;
    }

}

@@ -645,16 +645,77 @@
 diaId;%0A%0A
+    @JsonProperty(%22thumb_url%22)%0A    private String thumbUrl;%0A%0A
     @Jso
@@ -960,16 +960,41 @@
 Cover;%0A%0A
+    private String url;%0A%0A
     publ
@@ -2086,32 +2086,310 @@
 owCover;%0A    %7D%0A%0A
+    public String getThumbUrl() %7B%0A        return thumbUrl;%0A    %7D%0A%0A    public void setThumbUrl(String thumbUrl) %7B%0A        this.thumbUrl = thumbUrl;%0A    %7D%0A%0A    public String getUrl() %7B%0A        return url;%0A    %7D%0A%0A    public void setUrl(String url) %7B%0A        this.url = url;%0A    %7D%0A%0A
     public MpArt

修复issue#2 MpArticle 增加url和thumb_url