using SqlSugar; using System.ComponentModel.DataAnnotations; using WoodWood.Util.Validations; namespace Wood.Entity.SystemManage { /// /// 菜单信息 /// [SugarTable("SysMenu", "菜单信息")] public class MenuEntity : EntityBaseExtra { /// /// 父级id /// [SugarColumn(ColumnDescription = "父级id", DefaultValue = "0")] public long ParentId { get; set; } = 0; /// /// 名称 /// [SugarColumn(ColumnDescription = "名称", DefaultValue = "0",Length =32)] [Required] public string MenuName { get; set; } = ""; /// /// 路由名称 /// [SugarColumn(ColumnDescription = "路由名称", DefaultValue = "0", Length = 32, IsNullable = true)] public string? RouteName { get; set; } /// /// 路由路径 /// [SugarColumn(ColumnDescription = "路由路径", DefaultValue = "0", IsNullable = true)] public string? RoutePath { get; set; } /// /// 组件路径 /// [SugarColumn(ColumnDescription = "组件路径", DefaultValue = "0", IsNullable = true)] public string? ComponentPath { get; set; } /// /// 菜单图标 /// [SugarColumn(ColumnDescription = "菜单图标", DefaultValue = "0", Length = 32, IsNullable = true)] public string? MenuIcon { get; set; } /// /// 重定向路径 /// [SugarColumn(ColumnDescription = "重定向路径", DefaultValue = "0", IsNullable = true)] public string? RedirectPath { get; set; } /// /// 是否缓存 /// [SugarColumn(ColumnDescription = "是否缓存")] public bool IsCache { get; set; } = false; /// /// 是否新页面打开 /// [SugarColumn(ColumnDescription = "是否新页面打开")] public bool OpenNewWindow { get; set; } = false; /// /// 是否固定 /// [SugarColumn(ColumnDescription = "是否固定")] public bool IsAffix { get; set; } = false; /// /// 外链 /// [SugarColumn(ColumnDescription = "外链", Length = 256, IsNullable = true)] public string? OutLink { get; set; } /// /// 权限标识 /// [SugarColumn(ColumnDescription = "权限标识", Length = 128, IsNullable = true)] [UniqueValue(ErrorMessage ="权限标识不能重复!")] public string? Permission { get; set; } /// /// 排序 /// [SugarColumn(ColumnDescription = "排序", DefaultValue = "0")] public int Sort { get; set; } = 0; /// /// 菜单类型 1 目录 2 菜单 3 按钮 /// [SugarColumn(ColumnDescription = "菜单类型 1 目录 2 菜单 3 按钮", DefaultValue = "1")] public MenuTypeEnum MenuType { get; set; } = MenuTypeEnum.Directory; } }