TreeNodeVO.java
1.6 KB
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
package com.skua.modules.common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* @auther kangwei
* @create 2025-01-15-9:52
*/
@Data
@ApiModel(value="树结构", description="树结构")
public class TreeNodeVO {
@ApiModelProperty(value = "节点编号")
private String id;
@ApiModelProperty(value = "上级节点编号")
private String parentId;
@ApiModelProperty(value = "节点名称")
private String label;
@ApiModelProperty(value = "是否叶子结点")
private boolean isLeaf;
@ApiModelProperty(value = "完成时间")
private String completeTime;
@ApiModelProperty(value = "负责人")
private String responsibler;
@ApiModelProperty(value = "子集合")
private List<TreeNodeVO> children = new ArrayList<>();
public TreeNodeVO() {
}
public TreeNodeVO(String id, String parentId, String label) {
this.id = id;
this.parentId = parentId;
this.label = label;
}
public TreeNodeVO(String id, String parentId, String label, String completeTime, String responsibler) {
this.id = id;
this.parentId = parentId;
this.label = label;
this.completeTime = completeTime;
this.responsibler = responsibler;
}
public boolean isLeaf() {
isLeaf = true;
if(children != null && !children.isEmpty()){
isLeaf = false;
}
return isLeaf;
}
public void addChild(TreeNodeVO child) {
this.children.add(child);
}
}