Commit 3da03434 authored by shiyu's avatar shiyu

getMenu

parent 8ffb14a7
......@@ -246,6 +246,27 @@ public class OfficialAccountApi {
}
public Result getMenu() {
String token = getAccessToken();
String url = "https://api.weixin.qq.com/cgi-bin/menu/get" + "?access_token=" + token;
OkHttpUtil okHttpUtil = OkHttpUtil.builder().url(url);
okHttpUtil.get();
String responseStr = okHttpUtil.async();
logger.info("getMenu接口返回原文1 :{}", responseStr);
String url2 = "https://api.weixin.qq.com/cgi-bin/get_current_selfmenu_info" + "?access_token=" + token;
OkHttpUtil okHttpUtil2 = OkHttpUtil.builder().url(url2);
okHttpUtil2.get();
String responseStr2 = okHttpUtil2.async();
logger.info("getMenu接口返回原文2 :{}", responseStr2);
Map map = new HashMap<>();
map.put("responseStr", responseStr);
map.put("responseStr2", responseStr2);
return Result.success(map);
}
/**
* 随机加密
* @param hash
......@@ -279,4 +300,7 @@ public class OfficialAccountApi {
}
}
......@@ -45,7 +45,7 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
"/wx/returnOrder/**", "/wx/distributionOrder/confirmSigned", "/wx/distributionOrder/delivery", "/wx/distributionOrder/cancel",
"/wx/distributionOrder/refund",
"/wx/supplierItem/findItemsOfCurrentDistributor", "/wx/selfPage/updateSwitch", "/wx/supplierItem/findHomePage",
"/wx/specialPerformance/sendMsg", "/wx/specialPerformance/sendMsgTest", "/wx/groupPurchase/systemAddRecord"
"/wx/specialPerformance/sendMsg", "/wx/specialPerformance/sendMsgTest", "/wx/groupPurchase/systemAddRecord","/wx/officialAccount/**"
//下列路径上线注释
/* ,"/wx/specialPerformance/**"
, "/wx/supplierItem/**", "/wx/shareRecord/**", "/wx/distributionOrder/**", "/wx/selfPage/**", "/wx/auctionRecord/**",
......
......@@ -50,4 +50,10 @@ public class OfficialAccountController {
}
@ApiOperation(value = "getMenu")
@GetMapping("/getMenu")
public Result getMenu() {
return officialAccountApi.getMenu();
}
}
......@@ -82,6 +82,12 @@ public class OfficialAccountApiTest {
}
@Test
public void getMenu() {
officialAccountApi.getMenu();
}
@Test
public void sendSmsFromExcel() {
String fileName = "喜马拉雅品类用户手机号.xlsx";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment