using SqlSugar;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace YBDevice.Entity
{
    /// <summary>
    /// 菜单表
    /// </summary>
    [SugarTable("YB_Menu", TableDescription = "菜单表", IsDisabledUpdateAll = false, IsDisabledDelete = true)]
    public class YB_Menu
    {
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public System.Int32 Id { get; set; }

        /// <summary>
        /// 菜单名称
        /// </summary>
        [Required(ErrorMessage = "菜单名称不可为空")]
        [SugarColumn(ColumnDescription = "菜单名称", ColumnDataType = "nvarchar(50)")]
        public System.String Name { get; set; }

        /// <summary>
        /// 菜单地址
        /// </summary>
        [Required(ErrorMessage = "地址不可为空")]
        [SugarColumn(ColumnDescription = "菜单地址", ColumnDataType = "varchar(100)")]
        public System.String Url { get; set; }

        /// <summary>
        /// 图标,阿里图标
        /// </summary>
        [Required(ErrorMessage = "图标不可为空")]
        [SugarColumn(ColumnDescription = "图标,阿里图标", ColumnDataType = "varchar(100)")]
        public System.String Icon { get; set; }

        /// <summary>
        /// 排序,数字越小越靠前
        /// </summary>
        [Required(ErrorMessage = "排序不可为空")]
        [SugarColumn(ColumnDescription = "排序,数字越小越靠前")]
        public System.Int32 SortCode { get; set; }

        /// <summary>
        /// 上级ID
        /// </summary>
        [SugarColumn(ColumnDescription = "上级ID")]
        public System.Int32 ParentId { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDescription = "备注", ColumnDataType = "nvarchar(200)")]
        public System.String Remark { get; set; }

        /// <summary>
        /// 状态,0-禁用,1-启用
        /// </summary>
        [SugarColumn(ColumnDescription = "状态,0-禁用,1-启用")]
        public System.Int32 Status { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnDescription = "创建时间")]
        public System.DateTime CreateTime { get; set; }
        /// <summary>
        /// 子菜单列表
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public List<YB_Menu> Children { get; set; }
    }
}