package com.base.orbit.domain.enity;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.base.orbit.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 菜单表(SysMenu)实体类
 *
 * @author xj
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "sys_menu")
@ApiModel("菜单实体类")
public class SysMenu extends BaseEntity implements Serializable {

    private static final long serialVersionUID = -40356785423868312L;

    @ApiModelProperty("菜单编号")
    @TableId
    private Long menuId;

    @ApiModelProperty("父级菜单ID")
    private Long parentId;

    @ApiModelProperty("菜单名称")
    @NotBlank(message = "菜单名称不能为空！")
    private String menuName;

    @ApiModelProperty("菜单编号")
    private String menuCode;

    @ApiModelProperty("菜单类型（M目录 C菜单 F按钮）")
    @NotBlank(message = "菜单类型不能为空！")
    private String menuType;

    @ApiModelProperty("权限标识")
    private String permission;

    @ApiModelProperty("图标")
    private String icon;

    @ApiModelProperty("路由地址")
    private String path;

    @ApiModelProperty("组件路径")
    private String component;

    @ApiModelProperty("排序")
    private String sort;

    @ApiModelProperty("是否禁用 0：正常 | 1：禁用")
    private String forbidden;

    @ApiModelProperty("菜单状态（0正常 1停用）")
    private String status;

    @ApiModelProperty("菜单是否可见（默认不可见）")
    @TableField(exist = false)
    private boolean available = false;

    /**
     * 子菜单
     */
    @TableField(exist = false)
    private List<SysMenu> children = new ArrayList<SysMenu>();

}
