

package com.zcloud.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 菜单管理
 *
 *
 */
@Data
@TableName("sys_menu")
public class SysMenuEntity implements Serializable,Comparable<SysMenuEntity> {
	private static final long serialVersionUID = 1L;

	/**
	 * 菜单ID
	 */
	@TableId(type = IdType.AUTO)
	@ApiModelProperty(value = "主键")
	private Integer menuId;

	/**
	 * 父菜单ID，一级菜单为0
	 */
	@ApiModelProperty(value = "父菜单ID")
	private Integer parentId;

	/**
	 * 父菜单名称
	 */
	@TableField(exist=false)
	@ApiModelProperty(value = "父菜单名称")
	private String parentName;

	/**
	 * 菜单名称
	 */
	@ApiModelProperty(value = "菜单名称")
	private String name;

	/**
	 * 菜单URL
	 */
	@ApiModelProperty(value = "菜单URL")
	private String path;

	/**
	 * 菜单重定向
	 */
	@ApiModelProperty(value = "菜单重定向")
	private String  redirect;

	/**
	 * 菜单组件
	 */
	@ApiModelProperty(value = "菜单组件")
	private String component;

	/**
	 * 授权(多个用逗号分隔，如：user:list,user:create)
	 */
	@ApiModelProperty(value = "授权")
	private String perms;

	/**
	 * 类型    1：菜单   2：按钮
	 */
	@ApiModelProperty(value = "类型    1：菜单   2：按钮")
	private Integer type;

	/**
	 * 菜单meta
	 */
	@ApiModelProperty(value = "菜单meta")
	private String meta;

	/**
	 * 排序
	 */
	@ApiModelProperty(value = "排序")
	private Integer orderNum;

	/**
	 * 是否删除
	 */
	@ApiModelProperty(value = "是否删除")
	@TableField(fill = FieldFill.INSERT)
	private Integer isDelete;

	/**
	 * ztree属性
	 */
	@TableField(exist=false)
	@ApiModelProperty(value = "子集列表")
	private List<SysMenuEntity> list=new ArrayList<>();

	@Override
	public int compareTo(SysMenuEntity o) {
		return this.getOrderNum()-o.getOrderNum();
	}
}
