mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-04-22 21:00:51 +08:00
WxMenuButton增加缺失的media_id字段
This commit is contained in:
parent
977161cbeb
commit
184e6d785a
@ -12,9 +12,16 @@ public class WxMenuButton {
|
||||
private String name;
|
||||
private String key;
|
||||
private String url;
|
||||
private String mediaId;
|
||||
|
||||
private List<WxMenuButton> subButtons = new ArrayList<WxMenuButton>();
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this,
|
||||
ToStringStyle.JSON_STYLE);
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
@ -55,8 +62,11 @@ public class WxMenuButton {
|
||||
this.subButtons = subButtons;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
|
||||
public String getMediaId() {
|
||||
return mediaId;
|
||||
}
|
||||
|
||||
public void setMediaId(String mediaId) {
|
||||
this.mediaId = mediaId;
|
||||
}
|
||||
}
|
@ -52,6 +52,7 @@ public class WxMenuGsonAdapter implements JsonSerializer<WxMenu>, JsonDeserializ
|
||||
buttonJson.addProperty("name", button.getName());
|
||||
buttonJson.addProperty("key", button.getKey());
|
||||
buttonJson.addProperty("url", button.getUrl());
|
||||
buttonJson.addProperty("media_id", button.getMediaId());
|
||||
if (button.getSubButtons() != null && button.getSubButtons().size() > 0) {
|
||||
JsonArray buttonArray = new JsonArray();
|
||||
for (WxMenuButton sub_button : button.getSubButtons()) {
|
||||
@ -105,6 +106,7 @@ public class WxMenuGsonAdapter implements JsonSerializer<WxMenu>, JsonDeserializ
|
||||
button.setKey(GsonHelper.getString(json, "key"));
|
||||
button.setUrl(GsonHelper.getString(json, "url"));
|
||||
button.setType(GsonHelper.getString(json, "type"));
|
||||
button.setMediaId(GsonHelper.getString(json, "media_id"));
|
||||
return button;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user