using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace YBEE.EQM.Core
{
    /// <summary>
    /// 菜单表
    /// </summary>
    [Comment("菜单")]
    public partial class SysMenu : IEntity
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Comment("主键")]
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        /// <summary>
        /// 父Id
        /// </summary>
        [Comment("父Id")]
        public int Pid { get; set; }
        /// <summary>
        /// 父Ids
        /// </summary>
        [Comment("父Ids")]
        public string Pids { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        [Comment("名称")]
        [Required, MaxLength(20)]
        public string Name { get; set; }
        /// <summary>
        /// 编码
        /// </summary>
        [Comment("编码")]
        [Required, MaxLength(50)]
        public string Code { get; set; }
        /// <summary>
        /// 菜单类型（字典 0目录 1菜单 2按钮）
        /// </summary>
        [Comment("菜单类型")]
        [Required]
        public MenuType MenuType { get; set; }
        /// <summary>
        /// 图标
        /// </summary>
        [Comment("图标")]
        [MaxLength(20)]
        public string Icon { get; set; }
        /// <summary>
        /// 路由地址
        /// </summary>
        [Comment("路由地址")]
        [MaxLength(100)]
        public string Router { get; set; }
        /// <summary>
        /// 组件地址
        /// </summary>
        [Comment("组件地址")]
        [MaxLength(100)]
        public string Component { get; set; }
        /// <summary>
        /// 权限标识
        /// </summary>
        [Comment("权限标识")]
        [MaxLength(100)]
        public string Permission { get; set; }
        /// <summary>
        /// 打开方式（字典 0无 1组件 2内链 3外链）
        /// </summary>
        [Comment("打开方式")]
        [Required]
        public MenuOpenType OpenType { get; set; } = MenuOpenType.NONE;
        /// <summary>
        /// 是否可见
        /// </summary>
        [Comment("是否可见")]
        [Required, MaxLength(5)]
        public bool Visible { get; set; } = true;
        /// <summary>
        /// 内链地址
        /// </summary>
        [Comment("内链地址")]
        [MaxLength(100)]
        public string Link { get; set; }
        /// <summary>
        /// 重定向地址
        /// </summary>
        [Comment("重定向地址")]
        [MaxLength(100)]
        public string Redirect { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        [Comment("排序")]
        [Required]
        public int Sort { get; set; } = 0;
        /// <summary>
        /// 备注
        /// </summary>
        [Comment("备注")]
        [MaxLength(100)]
        public string Remark { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        [Comment("状态")]
        [Required]
        public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
    }
}