package com.lesingle.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lesingle.common.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * 菜单实体
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_sys_menu")
@Schema(description = "系统菜单实体")
public class SysMenu extends BaseEntity {

    @Schema(description = "菜单名称")
    private String name;

    @Schema(description = "路由路径")
    private String path;

    @Schema(description = "图标")
    private String icon;

    @Schema(description = "前端组件路径")
    private String component;

    @Schema(description = "父菜单ID")
    @TableField("parent_id")
    private Long parentId;

    @Schema(description = "权限标识")
    private String permission;

    @Schema(description = "排序")
    private Integer sort;

    @Schema(description = "子菜单列表")
    @TableField(exist = false)
    private List<SysMenu> children;
}
