com.foxinmy.weixin4j.mp.api
Class MenuApi

java.lang.Object
  extended by com.foxinmy.weixin4j.api.BaseApi
      extended by com.foxinmy.weixin4j.mp.api.MpApi
          extended by com.foxinmy.weixin4j.mp.api.MenuApi

public class MenuApi
extends MpApi

菜单相关API

Since:
JDK 1.6
Author:
jinyu(foxinmy@gmail.com)

Constructor Summary
MenuApi(TokenManager tokenManager)
           
 
Method Summary
 String createCustomMenu(List<Button> buttons, MenuMatchRule matchRule)
          创建个性化菜单
 ApiResult createMenu(List<Button> buttons)
          自定义菜单
 ApiResult deleteCustomMenu(String menuId)
          删除个性化菜单
 ApiResult deleteMenu()
          删除菜单
 List<Menu> getAllMenu()
          查询全部菜单(包含个性化菜单)
 List<Button> getMenu()
          查询菜单
 List<Button> matchCustomMenu(String userId)
          测试个性化菜单匹配结果
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuApi

public MenuApi(TokenManager tokenManager)
Method Detail

createMenu

public ApiResult createMenu(List<Button> buttons)
                     throws WeixinException
自定义菜单

Parameters:
buttons - 菜单列表
Returns:
处理结果
Throws:
WeixinException
See Also:
创建自定义菜单, Button

getMenu

public List<Button> getMenu()
                     throws WeixinException
查询菜单

Returns:
菜单集合
Throws:
WeixinException
See Also:
查询菜单, Button

getAllMenu

public List<Menu> getAllMenu()
                      throws WeixinException
查询全部菜单(包含个性化菜单)

Returns:
菜单集合
Throws:
WeixinException
See Also:
普通菜单, 个性化菜单, Button, Menu

deleteMenu

public ApiResult deleteMenu()
                     throws WeixinException
删除菜单

Returns:
处理结果
Throws:
WeixinException
See Also:
删除菜单

createCustomMenu

public String createCustomMenu(List<Button> buttons,
                               MenuMatchRule matchRule)
                        throws WeixinException
创建个性化菜单

Parameters:
buttons - 菜单列表
matchRule - 匹配规则 至少要有一个匹配信息是不为空
Returns:
菜单ID
Throws:
WeixinException
See Also:
创建个性化菜单, Button

deleteCustomMenu

public ApiResult deleteCustomMenu(String menuId)
                           throws WeixinException
删除个性化菜单

Returns:
处理结果
Throws:
WeixinException
See Also:
删除个性化菜单

matchCustomMenu

public List<Button> matchCustomMenu(String userId)
                             throws WeixinException
测试个性化菜单匹配结果

Parameters:
userId - 可以是粉丝的OpenID,也可以是粉丝的微信号。
Returns:
匹配到的菜单配置
Throws:
WeixinException
See Also:
测试个性化菜单, Button


Copyright © 2014–2017. All rights reserved.