群发预览消息格式中加入对towxname和touser的支持

This commit is contained in:
Binary Wang
2017-03-27 17:15:24 +08:00
parent 29353ffc3d
commit 54ee287c11
2 changed files with 16 additions and 6 deletions

View File

@@ -17,6 +17,7 @@ public class WxMpMassPreviewMessageGsonAdapter implements JsonSerializer<WxMpMas
public JsonElement serialize(WxMpMassPreviewMessage wxMpMassPreviewMessage, Type type, JsonSerializationContext jsonSerializationContext) {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("towxname", wxMpMassPreviewMessage.getToWxUsername());
jsonObject.addProperty("touser", wxMpMassPreviewMessage.getToWxUserOpenid());
if (WxConsts.MASS_MSG_NEWS.equals(wxMpMassPreviewMessage.getMsgType())) {
JsonObject news = new JsonObject();
news.addProperty("media_id", wxMpMassPreviewMessage.getMediaId());