34 lines
857 B
C#
34 lines
857 B
C#
|
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()];
|
|||
|
}
|
|||
|
}
|
|||
|
}
|