package com.ruoyi.project.business.domain.vo.train;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

/**
 * @author fangk
 * @date 2024/5/21
 * @desc FileDirectoryTreeVo 文件目录树
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Builder
// 排除为空
@JsonInclude(JsonInclude.Include.NON_NULL)
public class FileDirectoryTreeVo {

    /**
     * ID
     */
    private Long id;
    /**
     * 目录名
     */
    private String derectoryName;
    /**
     * 同ID，用于前端
     */
    private Long value;
    /**
     * 同目录名，用于前端
     */
    private String text;


    /**
     * 子目录
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<FileDirectoryTreeVo> children = new ArrayList<>();

    // private Long superDirectory;

    // opened:false 不加竟然打不开？？？   前端在初始化tree时，如果没有某些值，在前端直接修改可能会导致自动更新渲染失败
    // TODO 应该在前端初始化的时候就加上这些值，后面试一试
    private boolean opened = false;
    private boolean isfolder = true;
    private boolean isLeaf = true;
    private boolean selected;
}
