com.tmsps.ne4Weixin.api.entity.menu.Menu Maven / Gradle / Ivy
package com.tmsps.ne4Weixin.api.entity.menu;
import java.util.ArrayList;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
import com.tmsps.ne4Weixin.api.entity.BaseModel;
public class Menu extends BaseModel {
// 一级菜单最多三个
@JSONField(name = "button")
private List menuButton = new ArrayList();
public List getMenuButton() {
return menuButton;
}
public void setMenuButton(List menuButton) {
if (null == menuButton || menuButton.size() > 3) {
throw new IllegalArgumentException("一级菜单最多只有3个");
}
this.menuButton = menuButton;
}
public void addMenuButton(MenuButton mb) {
this.menuButton.add(mb);
if (this.menuButton.size() > 3) {
throw new IllegalArgumentException("一级菜单最多只有3个");
}
}
}