using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using TEAMModelOS.SDK.Context.Attributes.Azure;

namespace TEAMModelOS.Service.Models.Syllabus
{
    public class SyllabusNode
    {
        /// <summary>
        /// 
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        [Required(ErrorMessage = "{0} 必须填写")]
        public string title { get; set; }
        /// <summary>
        /// 是否展开
        /// </summary>
        public bool expand { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        [Required(ErrorMessage = "{0} 必须填写")]
        public int order { get; set; }
        /// <summary>
        /// 类型
        /// </summary>
        [Required(ErrorMessage = "{0} 必须填写")]
        public int type { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 节点Key
        /// </summary>
        [Required(ErrorMessage = "{0} 必须填写")]
        public string nodeKey { get; set; }
        ///// <summary>
        /////主键
        ///// </summary>
        //[Required(ErrorMessage = "{0} 必须填写")]
        //public string Id { get; set; }
        /// <summary>
        /// 父级
        /// </summary>
        [Required(ErrorMessage = "{0} 必须填写")]
        public string pid { get; set; }
        public SyllabusNode()
        {
            children = new List<SyllabusNode>();
        }
        public List<SyllabusNode> children { get; set; }
        /// <summary>
        /// 册别编码
        /// </summary>
        [Required(ErrorMessage = "{0} 必须填写")]
        [PartitionKey]
        public string volumeCode { get; set; }
        /// <summary>
        /// 数据状态
        /// </summary>
        [Required(ErrorMessage = "{0} 必须填写")]
        public int status { get; set; } = 1;
    }
}
