首页 > 代码库 > 微信自定义菜单
微信自定义菜单
微信自定义菜单
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);
微信自定义菜单
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。