zhuguifei
2025-04-28 442928123f63ee497d766f9a7a14f0a6ee067e25
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package org.jeecg.modules.doc.vo;
 
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecg.modules.doc.dto.DocTreeDTO;
import org.jeecg.modules.doc.entity.DocFilePath;
 
import java.util.ArrayList;
import java.util.List;
 
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DocTree {
    private Long id;
    private String title;
    private String key;
    private String path;
    private String pathId;
    private boolean isLeaf;
 
    private boolean permission;
 
    private List<DocTree> children = new ArrayList<>();
    private Slots slots = new Slots();
    private ScopedSlots scopedSlots = new ScopedSlots();
    private String parentId;
    public DocTree(DocFilePath p, String key) {
        QiwenFile qiwenFile = new QiwenFile(p.getFilePath(), p.getFileName(), p.isDirectory());
        this.path = qiwenFile.getPath();
        this.title = qiwenFile.getName();
        this.isLeaf = false;
        this.setKey(key);
        if(p.isDirectory()) {
            this.slots.setIcon("folder");
        } else {
            if(p.getExtendName().equals("doc")) {
                this.slots.setIcon("file-word");
            } else if(p.getExtendName().equals("xlsx"))
            this.slots.setIcon("file");
        }
 
        this.scopedSlots.setTitle("custom");
        this.pathId = p.getPathId();
        this.parentId = p.getParentId();
        this.permission = p.isPermission();
    }
 
    public DocTree(DocTreeDTO dto) {
        this.path = dto.getPath();
        this.title = dto.getTitle();
        this.isLeaf = dto.isLeaf();
        this.key = dto.getKey();
        this.pathId = dto.getPathId();
        this.id = dto.getId();
        this.parentId = dto.getParentId();
    }
 
    public boolean getIsLeaf() {
        return isLeaf;
    }
 
    public void setLeaf(boolean leaf) {
        isLeaf = leaf;
    }
 
 
    @Data
    public class Slots {
        private String icon;
    }
 
    @Data
    public class ScopedSlots {
        private String title;
    }
}