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 11package me .chanjar .weixin .mp .api .impl ;
22
3+ import com .google .gson .JsonObject ;
34import me .chanjar .weixin .common .bean .menu .WxMenu ;
45import me .chanjar .weixin .common .exception .WxErrorException ;
56import me .chanjar .weixin .mp .api .WxMpMenuService ;
@@ -68,8 +69,10 @@ public WxMenu menuGet() throws WxErrorException {
6869 @ Override
6970 public WxMenu menuTryMatch (String userid ) throws WxErrorException {
7071 String url = API_URL_PREFIX + "/trymatch" ;
72+ JsonObject jsonObject = new JsonObject ();
73+ jsonObject .addProperty ("user_id" ,userid );
7174 try {
72- String resultContent = this .wxMpService .get (url , "user_id=" + userid );
75+ String resultContent = this .wxMpService .post (url , jsonObject . toString () );
7376 return WxMenu .fromJson (resultContent );
7477 } catch (WxErrorException e ) {
7578 // 46003 不存在的菜单数据 46002 不存在的菜单版本
Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ public void testMenuCreate(WxMenu wxMenu) throws WxErrorException {
3434
3535 @ Test
3636 public void testMenuTryMatch () throws Exception {
37- //TODO
37+ WxMenu menu = this .wxService .getMenuService ().menuTryMatch ("..." );
38+ System .out .println (menu );
3839 }
3940
4041 @ Test
You can’t perform that action at this time.
0 commit comments