File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed
main/java/me/chanjar/weixin/mp/api
test/java/me/chanjar/weixin/mp/api/impl Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -24,20 +24,20 @@ public interface WxMpMenuService {
24
24
/**
25
25
* <pre>
26
26
* 自定义菜单删除接口
27
- * 详情请见: http ://mp.weixin.qq.com/wiki/index.php?title=自定义菜单删除接口
27
+ * 详情请见: https ://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141015&token=&lang=zh_CN
28
28
* </pre>
29
29
*/
30
30
void menuDelete () throws WxErrorException ;
31
31
32
32
/**
33
33
* <pre>
34
34
* 删除个性化菜单接口
35
- * 详情请见: http ://mp.weixin.qq.com/wiki/0/c48ccd12b69ae023159b4bfaa7c39c20.html
35
+ * 详情请见: https ://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1455782296&token=&lang=zh_CN
36
36
* </pre>
37
37
*
38
- * @param menuid
38
+ * @param menuId 个性化菜单的menuid
39
39
*/
40
- void menuDelete (String menuid ) throws WxErrorException ;
40
+ void menuDelete (String menuId ) throws WxErrorException ;
41
41
42
42
/**
43
43
* <pre>
Original file line number Diff line number Diff line change @@ -45,10 +45,12 @@ public void menuDelete() throws WxErrorException {
45
45
}
46
46
47
47
@ Override
48
- public void menuDelete (String menuid ) throws WxErrorException {
48
+ public void menuDelete (String menuId ) throws WxErrorException {
49
49
String url = API_URL_PREFIX + "/delconditional" ;
50
- String result = this .wxMpService .get (url , "menuid=" + menuid );
51
- log .debug ("根据MeunId({})删除菜单结果:{}" , menuid , result );
50
+ JsonObject jsonObject = new JsonObject ();
51
+ jsonObject .addProperty ("menuid" , menuId );
52
+ String result = this .wxMpService .post (url , jsonObject .toString ());
53
+ log .debug ("根据MeunId({})删除菜单结果:{}" , menuId , result );
52
54
}
53
55
54
56
@ Override
@@ -70,7 +72,7 @@ public WxMenu menuGet() throws WxErrorException {
70
72
public WxMenu menuTryMatch (String userid ) throws WxErrorException {
71
73
String url = API_URL_PREFIX + "/trymatch" ;
72
74
JsonObject jsonObject = new JsonObject ();
73
- jsonObject .addProperty ("user_id" ,userid );
75
+ jsonObject .addProperty ("user_id" , userid );
74
76
try {
75
77
String resultContent = this .wxMpService .post (url , jsonObject .toString ());
76
78
return WxMenu .fromJson (resultContent );
Original file line number Diff line number Diff line change @@ -100,6 +100,12 @@ public void testMenuDelete() throws WxErrorException {
100
100
this .wxService .getMenuService ().menuDelete ();
101
101
}
102
102
103
+ @ Test
104
+ public void testDeleteConditionalMenu () throws WxErrorException {
105
+ String menuId = "123" ;
106
+ this .wxService .getMenuService ().menuDelete (menuId );
107
+ }
108
+
103
109
@ DataProvider (name ="menu" )
104
110
public Object [][] getMenu () {
105
111
WxMenu menu = new WxMenu ();
You can’t perform that action at this time.
0 commit comments