File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
main/java/me/chanjar/weixin/mp/api/impl
test/java/me/chanjar/weixin/mp/api/impl Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
package me .chanjar .weixin .mp .api .impl ;
2
2
3
+ import com .google .gson .JsonObject ;
3
4
import me .chanjar .weixin .common .bean .menu .WxMenu ;
4
5
import me .chanjar .weixin .common .exception .WxErrorException ;
5
6
import me .chanjar .weixin .mp .api .WxMpMenuService ;
@@ -68,8 +69,10 @@ public WxMenu menuGet() throws WxErrorException {
68
69
@ Override
69
70
public WxMenu menuTryMatch (String userid ) throws WxErrorException {
70
71
String url = API_URL_PREFIX + "/trymatch" ;
72
+ JsonObject jsonObject = new JsonObject ();
73
+ jsonObject .addProperty ("user_id" ,userid );
71
74
try {
72
- String resultContent = this .wxMpService .get (url , "user_id=" + userid );
75
+ String resultContent = this .wxMpService .post (url , jsonObject . toString () );
73
76
return WxMenu .fromJson (resultContent );
74
77
} catch (WxErrorException e ) {
75
78
// 46003 不存在的菜单数据 46002 不存在的菜单版本
Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ public void testMenuCreate(WxMenu wxMenu) throws WxErrorException {
34
34
35
35
@ Test
36
36
public void testMenuTryMatch () throws Exception {
37
- //TODO
37
+ WxMenu menu = this .wxService .getMenuService ().menuTryMatch ("..." );
38
+ System .out .println (menu );
38
39
}
39
40
40
41
@ Test
You can’t perform that action at this time.
0 commit comments