|
|
package comxyp.pojo;
|
|
|
|
|
|
// 菜单类
|
|
|
public class Menu {
|
|
|
private Integer id; // 菜单的唯一标识符
|
|
|
private Integer pid; // 父菜单 ID,表示层级关系
|
|
|
private String title; // 菜单标题
|
|
|
private String href; // 菜单链接地址
|
|
|
private Integer spread; // 是否展开,通常用于表示菜单的展开状态
|
|
|
private String target; // 打开目标(如在新窗口中打开)
|
|
|
private String icon; // 菜单图标
|
|
|
|
|
|
// 获取菜单 ID
|
|
|
public Integer getId() {
|
|
|
return id;
|
|
|
}
|
|
|
|
|
|
// 设置菜单 ID
|
|
|
public void setId(Integer id) {
|
|
|
this.id = id;
|
|
|
}
|
|
|
|
|
|
// 获取父菜单 ID
|
|
|
public Integer getPid() {
|
|
|
return pid;
|
|
|
}
|
|
|
|
|
|
// 设置父菜单 ID
|
|
|
public void setPid(Integer pid) {
|
|
|
this.pid = pid;
|
|
|
}
|
|
|
|
|
|
// 获取菜单标题
|
|
|
public String getTitle() {
|
|
|
return title;
|
|
|
}
|
|
|
|
|
|
// 设置菜单标题
|
|
|
public void setTitle(String title) {
|
|
|
this.title = title;
|
|
|
}
|
|
|
|
|
|
// 获取菜单链接地址
|
|
|
public String getHref() {
|
|
|
return href;
|
|
|
}
|
|
|
|
|
|
// 设置菜单链接地址
|
|
|
public void setHref(String href) {
|
|
|
this.href = href;
|
|
|
}
|
|
|
|
|
|
// 获取展开状态
|
|
|
public Integer getSpread() {
|
|
|
return spread;
|
|
|
}
|
|
|
|
|
|
// 设置展开状态
|
|
|
public void setSpread(Integer spread) {
|
|
|
this.spread = spread;
|
|
|
}
|
|
|
|
|
|
// 获取打开目标
|
|
|
public String getTarget() {
|
|
|
return target;
|
|
|
}
|
|
|
|
|
|
// 设置打开目标
|
|
|
public void setTarget(String target) {
|
|
|
this.target = target;
|
|
|
}
|
|
|
|
|
|
// 获取菜单图标
|
|
|
public String getIcon() {
|
|
|
return icon;
|
|
|
}
|
|
|
|
|
|
// 设置菜单图标
|
|
|
public void setIcon(String icon) {
|
|
|
this.icon = icon;
|
|
|
}
|
|
|
|
|
|
// 默认构造函数
|
|
|
public Menu() {
|
|
|
}
|
|
|
|
|
|
// 带参数的构造函数,用于初始化菜单对象的属性
|
|
|
public Menu(Integer id, Integer pid, String title, String href, Integer spread, String target, String icon) {
|
|
|
this.id = id; // 初始化菜单 ID
|
|
|
this.pid = pid; // 初始化父菜单 ID
|
|
|
this.title = title; // 初始化菜单标题
|
|
|
this.href = href; // 初始化菜单链接地址
|
|
|
this.spread = spread; // 初始化菜单展开状态
|
|
|
this.target = target; // 初始化打开目标
|
|
|
this.icon = icon; // 初始化菜单图标
|
|
|
}
|
|
|
|
|
|
// 重写 toString 方法,方便打印菜单信息
|
|
|
@Override
|
|
|
public String toString() {
|
|
|
return "Menu{" +
|
|
|
"id=" + id + // 菜单 ID
|
|
|
", pid=" + pid + // 父菜单 ID
|
|
|
", title='" + title + '\'' + // 菜单标题
|
|
|
", href='" + href + '\'' + // 菜单链接
|
|
|
", spread=" + spread + // 展开状态
|
|
|
", target='" + target + '\'' + // 打开目标
|
|
|
", icon='" + icon + '\'' + // 菜单图标
|
|
|
'}';
|
|
|
}
|
|
|
} |