代码拉取完成,页面将自动刷新
同步操作将从 hm-tools/hm-tools-wxmp-adapter 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
package top.hmtools.wxmp.menu.apis;
import org.junit.Test;
import com.alibaba.fastjson.JSON;
import top.hmtools.wxmp.core.model.ErrcodeBean;
import top.hmtools.wxmp.menu.BaseTest;
import top.hmtools.wxmp.menu.models.simple.Button;
import top.hmtools.wxmp.menu.models.simple.CurrentSelfMenuInfoBean;
import top.hmtools.wxmp.menu.models.simple.MenuBean;
import top.hmtools.wxmp.menu.models.simple.MenuWapperBean;
public class IMenuApiTest extends BaseTest{
private IMenuApi menuApi ;
/**
* 测试创建自定义菜单
*/
@Test
public void testcreateMenu(){
String baseUrl = "hm.hn.cn";
//底部第一个主按钮
Button bbGuanwang = new Button();
bbGuanwang.setName("官网").setType("view").setUrl("http://m.hybo.net/main/index/index.html");
Button bbDongTai = new Button();
bbDongTai.setName("动态").setType("view").setUrl("http://"+baseUrl+"/main/news/index.html");
Button bbVideo = new Button();
bbVideo.setName("视频").setType("view").setUrl("http://"+baseUrl+"/main/news/video.html");
Button buttonBeanIndex = new Button();
buttonBeanIndex.setName("哈哈");
buttonBeanIndex.addSubButton(bbGuanwang,bbDongTai,bbVideo);
MenuBean menuBean = new MenuBean();
menuBean.addButton(buttonBeanIndex);
ErrcodeBean createMenu = this.menuApi.createMenu(menuBean);
this.printFormatedJson("测试 创建自定义菜单",createMenu);
}
/**
* 测试查询自定义菜单接口
*/
@Test
public void testGetMenu() {
MenuWapperBean menu = menuApi.getMenu();
this.printFormatedJson("测试 查询自定义菜单",menu);
}
/**
* 测试删除自定义菜单接口
*/
@Test
public void testdeleteAllMenu(){
ErrcodeBean deleteAllMenu = this.menuApi.deleteAllMenu();
this.printFormatedJson("测试删除自定义菜单接口",deleteAllMenu);
}
@Test
public void testgetCurrentSelfMenuInfoUri(){
CurrentSelfMenuInfoBean currentSelfMenuInfoUri = this.menuApi.getCurrentSelfMenuInfo();
System.out.println(JSON.toJSONString(currentSelfMenuInfoUri));
}
@Override
public void initSub() {
this.menuApi = this.wxmpSession.getMapper(IMenuApi.class);
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。