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)
-
-
Constructor Summary
Constructors Constructor Description MenuApi(com.foxinmy.weixin4j.token.TokenManager tokenManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
createCustomMenu(List<com.foxinmy.weixin4j.model.Button> buttons, MenuMatchRule matchRule)
创建个性化菜单com.foxinmy.weixin4j.http.weixin.ApiResult
createMenu(List<com.foxinmy.weixin4j.model.Button> buttons)
自定义菜单com.foxinmy.weixin4j.http.weixin.ApiResult
deleteCustomMenu(String menuId)
删除个性化菜单com.foxinmy.weixin4j.http.weixin.ApiResult
deleteMenu()
删除菜单List<Menu>
getAllMenu()
查询全部菜单(包含个性化菜单)List<com.foxinmy.weixin4j.model.Button>
getMenu()
查询菜单List<com.foxinmy.weixin4j.model.Button>
matchCustomMenu(String userId)
测试个性化菜单匹配结果-
Methods inherited from class com.foxinmy.weixin4j.mp.api.MpApi
weixinBundle
-
-
-
-
Method Detail
-
createMenu
public com.foxinmy.weixin4j.http.weixin.ApiResult createMenu(List<com.foxinmy.weixin4j.model.Button> buttons) throws com.foxinmy.weixin4j.exception.WeixinException
自定义菜单- Parameters:
buttons
- 菜单列表- Returns:
- 处理结果
- Throws:
com.foxinmy.weixin4j.exception.WeixinException
- See Also:
-
创建自定义菜单,
Button
-
getMenu
public List<com.foxinmy.weixin4j.model.Button> getMenu() throws com.foxinmy.weixin4j.exception.WeixinException
查询菜单- Returns:
- 菜单集合
- Throws:
com.foxinmy.weixin4j.exception.WeixinException
- See Also:
-
查询菜单,
Button
-
getAllMenu
public List<Menu> getAllMenu() throws com.foxinmy.weixin4j.exception.WeixinException
查询全部菜单(包含个性化菜单)
-
deleteMenu
public com.foxinmy.weixin4j.http.weixin.ApiResult deleteMenu() throws com.foxinmy.weixin4j.exception.WeixinException
删除菜单- Returns:
- 处理结果
- Throws:
com.foxinmy.weixin4j.exception.WeixinException
- See Also:
- 删除菜单
-
createCustomMenu
public String createCustomMenu(List<com.foxinmy.weixin4j.model.Button> buttons, MenuMatchRule matchRule) throws com.foxinmy.weixin4j.exception.WeixinException
创建个性化菜单- Parameters:
buttons
- 菜单列表matchRule
- 匹配规则 至少要有一个匹配信息是不为空- Returns:
- 菜单ID
- Throws:
com.foxinmy.weixin4j.exception.WeixinException
- See Also:
-
创建个性化菜单,
Button
-
deleteCustomMenu
public com.foxinmy.weixin4j.http.weixin.ApiResult deleteCustomMenu(String menuId) throws com.foxinmy.weixin4j.exception.WeixinException
删除个性化菜单- Returns:
- 处理结果
- Throws:
com.foxinmy.weixin4j.exception.WeixinException
- See Also:
- 删除个性化菜单
-
matchCustomMenu
public List<com.foxinmy.weixin4j.model.Button> matchCustomMenu(String userId) throws com.foxinmy.weixin4j.exception.WeixinException
测试个性化菜单匹配结果- Parameters:
userId
- 可以是粉丝的OpenID,也可以是粉丝的微信号。- Returns:
- 匹配到的菜单配置
- Throws:
com.foxinmy.weixin4j.exception.WeixinException
- See Also:
-
测试个性化菜单,
Button
-
-