增加点击图文消息跳转链接

This commit is contained in:
alanchen
2015-09-03 17:54:51 +08:00
parent cf9ccbc54d
commit a645a28267
2 changed files with 24 additions and 2 deletions

View File

@@ -32,6 +32,9 @@ public class WxMpMaterialNewsArticleGsonAdapter implements JsonSerializer<WxMpMa
articleJson.addProperty("digest", article.getDigest());
}
articleJson.addProperty("show_cover_pic", article.isShowCoverPic() ? "1" : "0");
if (null != article.getUrl()) {
articleJson.addProperty("url", article.getUrl());
}
return articleJson;
}
@@ -67,6 +70,10 @@ public class WxMpMaterialNewsArticleGsonAdapter implements JsonSerializer<WxMpMa
if (showCoverPic != null && !showCoverPic.isJsonNull()) {
article.setShowCoverPic(GsonHelper.getAsBoolean(showCoverPic));
}
JsonElement url = articleInfo.get("url");
if (url != null && !url.isJsonNull()) {
article.setUrl(GsonHelper.getAsString(url));
}
return article;
}
}