package com.ningdatech.carapi.sys.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;

import javax.validation.constraints.Size;
import java.time.LocalDateTime;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 菜单
 * </p>
 *
 * @author PoffyZhang
 * @since 2022-9-30
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("nd_menu")
@ApiModel(value = "Menu", description = "菜单")
@AllArgsConstructor
public class Menu extends TreeEntity<Menu, Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 权限"
     */
    @ApiModelProperty(value = "权限")
    @Size(max = 200, message = "权限长度不能超过200")
    @TableField(value = "permission", condition = LIKE)
    private String permission;
    /**
     * 类型;[0-菜单 1-目录 2-按钮]
     */
    @ApiModelProperty(value = "类型")
    @TableField(value = "type")
    private Integer type;

    /**
     * 组件
     */
    @ApiModelProperty(value = "组件")
    @Size(max = 255, message = "组件长度不能超过255")
    @TableField(value = "component", condition = LIKE)
    private String component;

    /**
     * 菜单图标
     */
    @ApiModelProperty(value = "菜单图标")
    @Size(max = 255, message = "菜单图标长度不能超过255")
    @TableField(value = "icon", condition = LIKE)
    private String icon;

    /**
     * 子菜单数目
     */
    @ApiModelProperty(value = "是否隐藏")
    @TableField(value = "`hidden`")
    private Integer hidden;

    /**
     * activeMenu
     */
    @ApiModelProperty(value = "activeMenu")
    @TableField(value = "`active_menu`")
    private String activeMenu;


    /**
     * 跳转
     */
    @ApiModelProperty(value = "跳转")
    @TableField(value = "redirect")
    private String redirect;
}
