package com.qiaoba.api.system.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.qiaoba.common.base.entity.BaseEntity;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.qiaoba.common.base.validate.AddGroup;
import com.qiaoba.common.base.validate.EditGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 菜单信息 sys_menu
 *
 * @author ailanyin
 * @version 1.0
 * @since 2022-09-22 04:20:28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sys_menu")
public class SysMenu extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 菜单ID
     */
    @TableId
    @NotNull(message = "主键不能为空", groups = {EditGroup.class})
    @Size(max = 20, message = "主键不能超过{max}个字符", groups = {EditGroup.class})
    private String menuId;

    /**
     * 菜单名称
     */
    @NotBlank(message = "菜单名称不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 30, message = "菜单名称不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String menuName;

    /**
     * 父菜单ID
     */
    @Size(max = 20, message = "父ID不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String parentId;

    /**
     * 显示顺序
     */
    @Min(value = 1, message = "排序最小允许: {value}", groups = {AddGroup.class, EditGroup.class})
    private Integer orderNum;

    /**
     * 路由地址
     */
    @Size(max = 50, message = "路由地址不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String path;

    /**
     * 组件路径
     */
    @Size(max = 50, message = "路由地址不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String component;

    /**
     * 路由参数
     */
    @Size(max = 100, message = "路由地址不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String query;

    /**
     * 是否为外链（0否 1是）
     */
    @Size(max = 1, message = "外链不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String isFrame;

    /**
     * 是否缓存（0不缓存 1缓存）
     */
    @Size(max = 1, message = "缓存不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String isCache;

    /**
     * 类型（M目录 C菜单 F按钮）
     */
    @Size(max = 1, message = "类型不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String menuType;

    /**
     * 显示状态（0隐藏 1显示）
     */
    @Size(max = 1, message = "显示状态不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String isVisible;

    /**
     * 权限字符串
     */
    @Size(max = 50, message = "权限字符串不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String perms;

    /**
     * 菜单图标
     */
    @Size(max = 30, message = "菜单图标不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String icon;


}
