using BPA.SAAS.Manage.Comm.Util;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.Org.Dtos.Organize
{
    public class OrgTreeNode : ITreeNode
    {

        public int Type { get; set; }

        /// <summary>
        /// Id
        /// </summary>
        public string key { get; set; }

        /// <summary>
        /// 父Id
        /// </summary>
        public string parentId { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        public string title { get; set; }

        /// <summary>
        /// 值
        /// </summary>
        public string value { get; set; }

        /// <summary>
        /// 排序，越小优先级越高
        /// </summary>
        public int weight { get; set; }

        /// <summary>
        /// 子节点
        /// </summary>
        public List<OrgTreeNode> Children { get; set; } = new List<OrgTreeNode>();


        public string GetId()
        {
            return key;
        }

        public string GetPid()
        {
            return parentId;
        }

        public void SetChildren(IList children)
        {
            Children = (List<OrgTreeNode>)children;
        }
    }
}
