package com.cpop.system.business.entity;

import com.cpop.core.base.entity.BaseEntity;
import com.cpop.core.base.entity.BaseInsertListener;
import com.cpop.core.base.entity.BaseUpdateListener;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 系统菜单表 实体类。
 *
 * @author DB
 * @since 2023-10-19
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Table(value = "cp_sys_menu", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
public class Menu extends BaseEntity implements Serializable {

    /**
     * 菜单ID
     */
    @Id
    private String id;

    /**
     * 父级菜单ID
     */
    private String parentMenu;

    /**
     * 菜单名称
     */
    private String name;

    /**
     * 菜单图标
     */
    private String icon;

    /**
     * 菜单路由，父菜单为空
     */
    private String component;

    /**
     * 标记菜单的状态 0:禁用 1：正常（根据权限正常显示）
     */
    private Boolean status;

    /**
     * 菜单类型，0:目录，1:菜单，2:按钮
     */
    private Integer type;

    /**
     * 权限
     */
    private String permission;

    /**
     * 重定向路径，一级菜单有值
     */
    private String redirect;

    /**
     * 排序，值越小越靠前，一级菜单有值
     */
    private Integer orderNo;

    /**
     * 路由地址
     */
    private String path;

    /**
     * 标题
     */
    private String title;

    /**
     * 隐藏菜单
     */
    private Boolean hideMenu;

    /**
     * 是否忽略KeepAlive缓存
     */
    private Boolean ignoreKeepAlive;

    /**
     * 菜单模块
     */
    private String userType;

}
