Search in sources :

Example 1 with MultiMenuInfo

use of org.usc.wechat.mp.sdk.vo.menu.MultiMenuInfo in project wechat-mp-sdk by usc.

the class MenuUtilTest method main.

public static void main(String[] args) throws URISyntaxException {
    List<SingleMenuInfo> subMenuInfos = new ArrayList<SingleMenuInfo>();
    subMenuInfos.add(MenuType.VIEW.buildSingleMenuInfo("搜索", "http://www.soso.com/"));
    subMenuInfos.add(MenuType.VIEW.buildSingleMenuInfo("视频", "http://v.qq.com/"));
    subMenuInfos.add(MenuType.CLICK.buildSingleMenuInfo("赞一下我们", "V1001_GOOD"));
    List<MenuInfo> menuInfos = new ArrayList<MenuInfo>();
    menuInfos.add(MenuType.CLICK.buildSingleMenuInfo("今日歌曲", "V1001_TODAY_MUSIC"));
    menuInfos.add(MenuType.CLICK.buildSingleMenuInfo("歌手简介", "V1001_TODAY_SINGER"));
    menuInfos.add(new MultiMenuInfo("菜单", subMenuInfos));
    Menu menu = new Menu(menuInfos);
    System.out.println(MenuUtil.createMenu(Constants.LICENSE, menu));
    System.out.println(MenuUtil.getMenu(Constants.LICENSE));
    System.out.println(MenuUtil.deleteMenu(Constants.LICENSE));
}
Also used : MultiMenuInfo(org.usc.wechat.mp.sdk.vo.menu.MultiMenuInfo) SingleMenuInfo(org.usc.wechat.mp.sdk.vo.menu.SingleMenuInfo) MultiMenuInfo(org.usc.wechat.mp.sdk.vo.menu.MultiMenuInfo) MenuInfo(org.usc.wechat.mp.sdk.vo.menu.MenuInfo) SingleMenuInfo(org.usc.wechat.mp.sdk.vo.menu.SingleMenuInfo) ArrayList(java.util.ArrayList) Menu(org.usc.wechat.mp.sdk.vo.menu.Menu)

Aggregations

ArrayList (java.util.ArrayList)1 Menu (org.usc.wechat.mp.sdk.vo.menu.Menu)1 MenuInfo (org.usc.wechat.mp.sdk.vo.menu.MenuInfo)1 MultiMenuInfo (org.usc.wechat.mp.sdk.vo.menu.MultiMenuInfo)1 SingleMenuInfo (org.usc.wechat.mp.sdk.vo.menu.SingleMenuInfo)1