zoukankan      html  css  js  c++  java
  • 递归获取当前父节点下的所有子集

    /// <summary>
    /// 获取当前父节点下的所有子集
    /// </summary>
    /// <param name="parent_id"></param>
    /// <param name="allFolderList"></param>
    /// <returns></returns>
    private List<MyManageFolderInfoResponse> GetChildFolder(string parent_id, List<MyManageFolderInfoResponse> allFolderList)
    {
    var query = from a in allFolderList
    where a.parent_id == parent_id
    select a;
    return query.ToList().Concat(query.ToList().SelectMany(t => GetChildFolder(t.b_id, allFolderList))).ToList();

    }

    /// <summary>
    /// 我管理的文件夹
    /// </summary>
    public class MyManageFolderInfoResponse
    {
    public string parent_id { get; set; }
    /// <summary>
    /// 级数
    /// </summary>
    public int step_number { get; set; } = 1;

    public string b_id { get; set; }
    /// <summary>
    /// 文件夹名称
    /// </summary>
    public string folder_name { get; set; }
    /// <summary>
    /// 文件夹类型,1:常规文件夹,2:任务文件夹
    /// </summary>
    public int folder_type { get; set; } = 1;
    /// <summary>
    /// 公开/不公开,1:不公开,2:对所有教师公开,3:对部分教师公开
    /// </summary>
    public int is_public { get; set; } = 1;
    /// <summary>
    /// 公开教师ID
    /// </summary>

    public string public_user_ids { get; set; }

    /// <summary>
    /// 管理者教师ID
    /// </summary>

    public string manage_user_ids { get; set; }
    /// <summary>
    /// 上传教师ID(任务文件夹)
    /// </summary>

    public string teacher_user_ids { get; set; }
    /// <summary>
    /// 文档数量
    /// </summary>
    public int file_count { get; set; } = 0;

    /// <summary>
    /// 创建人
    /// </summary>
    public string create_by { get; set; }
    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime create_time { get; set; }

    /// <summary>
    /// children
    /// </summary>
    public List<MyManageFolderInfoResponse> children { get; set; }
    }

  • 相关阅读:
    C语言第五次作业
    c语言第4次作业
    第12次作业
    C语言第9次作业
    C语言第8次作业2
    C语言第8次作业
    C语言第七次作业---要死了----
    C语言第七次作业
    物联网工程实践第二次作业
    物联网工程实践第一次作业
  • 原文地址:https://www.cnblogs.com/pengchong/p/14120267.html
Copyright © 2011-2022 走看看