33import java .io .InputStream ;
44import java .io .InputStreamReader ;
55import java .io .Serializable ;
6- import java .nio .charset .Charset ;
76import java .util .ArrayList ;
87import java .util .List ;
98
10- import me .chanjar .weixin .common .util .json .WxGsonBuilder ;
119import org .apache .commons .codec .Charsets ;
1210
11+ import me .chanjar .weixin .common .util .json .WxGsonBuilder ;
12+
1313/**
1414 * 企业号菜单
1515 * @author Daniel Qian
@@ -19,6 +19,8 @@ public class WxMenu implements Serializable {
1919
2020 private List <WxMenuButton > buttons = new ArrayList <WxMenuButton >();
2121
22+ private WxMenuRule matchRule ;
23+
2224 public List <WxMenuButton > getButtons () {
2325 return buttons ;
2426 }
@@ -27,6 +29,14 @@ public void setButtons(List<WxMenuButton> buttons) {
2729 this .buttons = buttons ;
2830 }
2931
32+ public WxMenuRule getMatchRule () {
33+ return matchRule ;
34+ }
35+
36+ public void setMatchRule (WxMenuRule matchRule ) {
37+ this .matchRule = matchRule ;
38+ }
39+
3040 public String toJson () {
3141 return WxGsonBuilder .create ().toJson (this );
3242 }
@@ -118,5 +128,74 @@ public String toString() {
118128 '}' ;
119129 }
120130 }
121-
131+
132+ public static class WxMenuRule {
133+ private String groupId ;
134+ private String sex ;
135+ private String country ;
136+ private String province ;
137+ private String city ;
138+ private String clientPlatformType ;
139+
140+ public String getGroupId () {
141+ return groupId ;
142+ }
143+
144+ public void setGroupId (String groupId ) {
145+ this .groupId = groupId ;
146+ }
147+
148+ public String getSex () {
149+ return sex ;
150+ }
151+
152+ public void setSex (String sex ) {
153+ this .sex = sex ;
154+ }
155+
156+ public String getCountry () {
157+ return country ;
158+ }
159+
160+ public void setCountry (String country ) {
161+ this .country = country ;
162+ }
163+
164+ public String getProvince () {
165+ return province ;
166+ }
167+
168+ public void setProvince (String province ) {
169+ this .province = province ;
170+ }
171+
172+ public String getCity () {
173+ return city ;
174+ }
175+
176+ public void setCity (String city ) {
177+ this .city = city ;
178+ }
179+
180+ public String getClientPlatformType () {
181+ return clientPlatformType ;
182+ }
183+
184+ public void setClientPlatformType (String clientPlatformType ) {
185+ this .clientPlatformType = clientPlatformType ;
186+ }
187+
188+ @ Override
189+ public String toString () {
190+ return "matchrule:{" +
191+ "group_id='" + groupId + '\'' +
192+ ", sex='" + sex + '\'' +
193+ ", country" + country + '\'' +
194+ ", province" + province + '\'' +
195+ ", city" + city + '\'' +
196+ ", client_platform_type" + clientPlatformType + '\'' +
197+ "}" ;
198+ }
199+ }
200+
122201}
0 commit comments