|
|
@@ -20,6 +20,7 @@ public class WxMpMaterialNewsArticleGsonAdapter implements JsonSerializer<WxMpMa |
|
|
|
JsonObject articleJson = new JsonObject(); |
|
|
|
|
|
|
|
articleJson.addProperty("thumb_media_id", article.getThumbMediaId()); |
|
|
|
articleJson.addProperty("thumb_url",article.getThumbUrl()); |
|
|
|
articleJson.addProperty("title", article.getTitle()); |
|
|
|
articleJson.addProperty("content", article.getContent()); |
|
|
|
if (null != article.getAuthor()) { |
|
|
@@ -66,6 +67,10 @@ public class WxMpMaterialNewsArticleGsonAdapter implements JsonSerializer<WxMpMa |
|
|
|
if (thumbMediaId != null && !thumbMediaId.isJsonNull()) { |
|
|
|
article.setThumbMediaId(GsonHelper.getAsString(thumbMediaId)); |
|
|
|
} |
|
|
|
JsonElement thumbUrl = articleInfo.get("thumb_url"); |
|
|
|
if(thumbUrl != null && !thumbUrl.isJsonNull()) { |
|
|
|
article.setThumbUrl(GsonHelper.getAsString(thumbUrl)); |
|
|
|
} |
|
|
|
JsonElement showCoverPic = articleInfo.get("show_cover_pic"); |
|
|
|
if (showCoverPic != null && !showCoverPic.isJsonNull()) { |
|
|
|
article.setShowCoverPic(GsonHelper.getAsBoolean(showCoverPic)); |
|
|
|