Package com.foxinmy.weixin4j.mp.api
Class MenuApi
- java.lang.Object
-
- com.foxinmy.weixin4j.api.BaseApi
-
- com.foxinmy.weixin4j.mp.api.MpApi
-
- com.foxinmy.weixin4j.mp.api.MenuApi
-
public class MenuApi extends MpApi
菜单相关API- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Field Summary
-
Fields inherited from class com.foxinmy.weixin4j.api.BaseApi
weixinExecutor
-
-
Constructor Summary
Constructors Constructor Description MenuApi(TokenManager tokenManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 com.foxinmy.weixin4j.mp.api.MpApi
weixinBundle
-
Methods inherited from class com.foxinmy.weixin4j.api.BaseApi
getRequestUri
-
-
-
-
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
-
-