Laservall_manager_system/VOL.DingTalk/Models/Biz/DingTalkDepartment.cs

34 lines
857 B
C#
Raw Normal View History

2025-09-26 13:35:45 +08:00
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<DingTalkDepartment> subDepartments { get; set; } = [];
/// <summary>
/// 递归获取部门ID列表
/// </summary>
/// <returns></returns>
public List<int> GetDeptIds()
{
return [dept_id, ..subDepartments.SelectMany(i => i.GetDeptIds()).ToList()];
}
}
}