微信自定义菜单
Posted stono
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了微信自定义菜单相关的知识,希望对你有一定的参考价值。
微信自定义菜单
String accessToken = (String) obj1; String url = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token="+accessToken; Map<String, Object> request = new HashMap<String, Object>(); List<Map<String, Object>> buttonList= new ArrayList<Map<String,Object>>(); Map<String, Object> jichangyouhui = new HashMap<String, Object>(); jichangyouhui.put("name", "优惠"); List<Map<String, String>> subButtonList01 = new ArrayList<Map<String,String>>(); Map<String, String> youhuixinxi = new HashMap<String, String>(); youhuixinxi.put("type", "view"); youhuixinxi.put("name", "优惠 "); youhuixinxi.put("url", "http://weix "); subButtonList01.add(youhuixinxi); Map<String, String> danpintuijian = new HashMap<String, String>(); danpintuijian.put("type", "view"); danpintuijian.put("name", " 推荐"); danpintuijian.put("url", "http://weixin "); subButtonList01.add(danpintuijian); jichangyouhui.put("sub_button", subButtonList01); buttonList.add(jichangyouhui);
request.put("button", buttonList); @SuppressWarnings("unchecked") Map<String,String> postMap = template.postForObject(url, request, Map.class);
以上是关于微信自定义菜单的主要内容,如果未能解决你的问题,请参考以下文章