SysMenu.java 2.1 KB
package com.youjia.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.youjia.common.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

/**
 * 菜单 / 权限表(sys_menu)。菜单权限码与按钮权限码同表维护,由 menu_type 区分。
 */
@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@TableName("sys_menu")
@Schema(description = "菜单 / 权限")
public class SysMenu extends BaseEntity {

    @TableId(value = "menu_id", type = IdType.AUTO)
    @Schema(description = "菜单 ID(自增主键,仅内部关联使用)")
    private Long menuId;

    /**
     * 跨环境唯一编码(固定值,点分命名与权限码层级对齐,如 store.import / system.role.save)。
     * 多环境迁移、外部系统引用菜单以本字段对齐,不依赖自增 id;全局唯一(uk_menu_code)。
     */
    @Schema(description = "菜单唯一编码(固定值,跨环境迁移以它对齐)")
    private String menuCode;

    /**
     * 父级菜单唯一编码,根为 NULL。父子引用统一走编码,不再有数字 parent_id。
     */
    @Schema(description = "父级菜单唯一编码,根为 NULL")
    private String parentCode;

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

    @Schema(description = "类型:1-目录 2-菜单 3-按钮")
    private Integer menuType;

    @Schema(description = "权限码,命名规则 模块:功能:操作")
    private String permCode;

    @Schema(description = "所属产品 / 模块分组")
    private String product;

    @Schema(description = "前端路由")
    private String route;

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

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

    @Schema(description = "是否可见:1-可见 0-隐藏")
    private Integer visible;

    @Schema(description = "状态:1-启用 0-停用")
    private Integer status;
}