using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace VOL.DingTalk.Models.Biz { public class DingTalkDepartment { public bool auto_add_user { get; set; } public bool create_dept_group { get; set; } public int dept_id { get; set; } public string name { get; set; } public int parent_id { get; set; } public string ext { get; set; } [JsonIgnore] public List subDepartments { get; set; } = []; /// /// 递归获取部门ID列表 /// /// public List GetDeptIds() { return [dept_id, ..subDepartments.SelectMany(i => i.GetDeptIds()).ToList()]; } } }