• 递归获取当前节点和所有父节点


    List<MyManageFolderInfoResponse> listParentGolder = new List<MyManageFolderInfoResponse>();
    /// <summary>
    /// 获取当前节点和所有父节点
    /// </summary>
    /// <param name="myManageFolderEntity"></param>
    /// <param name="listFolder"></param>
    /// <returns></returns>
    private MyManageFolderInfoResponse GetParentFolder(MyManageFolderInfoResponse myManageFolderEntity, List<MyManageFolderInfoResponse> listFolder)
    {
    listParentGolder.Add(myManageFolderEntity);
    var result = listFolder.Where(x => x.b_id == myManageFolderEntity.parent_id).ToList();
    if (result.Count() > 0 /*&& result[0].parent_id != "0"*/)
    {
    return GetParentFolder(result[0], listFolder);
    }
    else
    {
    return myManageFolderEntity;
    }

    }

    /// <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; }
    }

  • 相关阅读:
    SSL/TLS
    openssl数字证书常见格式 协议
    Jetty 与 Tomcat 的比较
    Spring Boot 邮件配置
    SSL与TLS的区别以及介绍
    pring Boot 与Spring Cloud版本对应
    iOS initWithFrame、initWithCoder、awakeFromNib的区别解析
    浅析iOS tableview的selectRowAtIndexPath选中无效(默认选中cell无效)
    iOS 多线程NSThread理解与场景示例
    iOS7 UIWebview加载进度条实现
  • 原文地址:https://www.cnblogs.com/pengchong/p/14120280.html
Copyright © 2020-2023  润新知