Skip to content

Commit f6c24ac

Browse files
committed
微信个性化菜单接口group_id改为tag_id
详细参见http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1455782296&token=&lang=zh_CN
1 parent e57eb3f commit f6c24ac

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/WxMenu.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,20 @@ public String toString() {
129129
}
130130

131131
public static class WxMenuRule {
132-
private String groupId;
132+
private String tagId;
133133
private String sex;
134134
private String country;
135135
private String province;
136136
private String city;
137137
private String clientPlatformType;
138138
private String language;
139139

140-
public String getGroupId() {
141-
return groupId;
140+
public String getTagId() {
141+
return tagId;
142142
}
143143

144-
public void setGroupId(String groupId) {
145-
this.groupId = groupId;
144+
public void setTagId(String tagId) {
145+
this.tagId = tagId;
146146
}
147147

148148
public String getSex() {
@@ -196,7 +196,7 @@ public void setLanguage(String language) {
196196
@Override
197197
public String toString() {
198198
return "matchrule:{" +
199-
"group_id='" + groupId + '\'' +
199+
"tag_id='" + tagId + '\'' +
200200
", sex='" + sex + '\'' +
201201
", country" + country + '\'' +
202202
", province" + province + '\'' +

weixin-java-common/src/main/java/me/chanjar/weixin/common/util/json/WxMenuGsonAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected JsonObject convertToJson(WxMenu.WxMenuButton button) {
6262

6363
protected JsonObject convertToJson(WxMenu.WxMenuRule menuRule){
6464
JsonObject matchRule = new JsonObject();
65-
matchRule.addProperty("group_id",menuRule.getGroupId());
65+
matchRule.addProperty("tag_id",menuRule.getTagId());
6666
matchRule.addProperty("sex",menuRule.getSex());
6767
matchRule.addProperty("country",menuRule.getCountry());
6868
matchRule.addProperty("province",menuRule.getProvince());

weixin-java-common/src/test/java/me/chanjar/weixin/common/bean/WxMenuTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void testAddConditionalToJson(String json) {
6767
menu.getButtons().add(button1);
6868

6969
WxMenu.WxMenuRule wxMenuRule = new WxMenu.WxMenuRule();
70-
wxMenuRule.setGroupId("2");
70+
wxMenuRule.setTagId("2");
7171
wxMenuRule.setSex("1");
7272
wxMenuRule.setCountry("中国");
7373
wxMenuRule.setProvince("广东");

0 commit comments

Comments
 (0)