File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
weixin-java-common/src/main/java/me/chanjar/weixin/common Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,16 @@ public class WxMenuButton {
12
12
private String name ;
13
13
private String key ;
14
14
private String url ;
15
+ private String mediaId ;
15
16
16
17
private List <WxMenuButton > subButtons = new ArrayList <WxMenuButton >();
17
18
19
+ @ Override
20
+ public String toString () {
21
+ return ToStringBuilder .reflectionToString (this ,
22
+ ToStringStyle .JSON_STYLE );
23
+ }
24
+
18
25
public String getType () {
19
26
return type ;
20
27
}
@@ -55,8 +62,11 @@ public void setSubButtons(List<WxMenuButton> subButtons) {
55
62
this .subButtons = subButtons ;
56
63
}
57
64
58
- @ Override
59
- public String toString () {
60
- return ToStringBuilder .reflectionToString (this , ToStringStyle .JSON_STYLE );
65
+ public String getMediaId () {
66
+ return mediaId ;
67
+ }
68
+
69
+ public void setMediaId (String mediaId ) {
70
+ this .mediaId = mediaId ;
61
71
}
62
72
}
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ protected JsonObject convertToJson(WxMenuButton button) {
52
52
buttonJson .addProperty ("name" , button .getName ());
53
53
buttonJson .addProperty ("key" , button .getKey ());
54
54
buttonJson .addProperty ("url" , button .getUrl ());
55
+ buttonJson .addProperty ("media_id" , button .getMediaId ());
55
56
if (button .getSubButtons () != null && button .getSubButtons ().size () > 0 ) {
56
57
JsonArray buttonArray = new JsonArray ();
57
58
for (WxMenuButton sub_button : button .getSubButtons ()) {
@@ -105,6 +106,7 @@ protected WxMenuButton convertFromJson(JsonObject json) {
105
106
button .setKey (GsonHelper .getString (json , "key" ));
106
107
button .setUrl (GsonHelper .getString (json , "url" ));
107
108
button .setType (GsonHelper .getString (json , "type" ));
109
+ button .setMediaId (GsonHelper .getString (json , "media_id" ));
108
110
return button ;
109
111
}
110
112
You can’t perform that action at this time.
0 commit comments