liusheng
2025-02-14 b0da81d9276922b223583807093bd6420d9bf705
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
package com.smartor.domain;
 
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.ObjectUtils;
 
import java.util.ArrayList;
import java.util.List;
 
@ApiModel(value = "TreeNode", description = "节点树")
@Data
public class TreeNode {
    @ApiModelProperty(value = "节点名称")
    private String name;
 
    @ApiModelProperty(value = "子节点集合")
    private List<TreeNode> children;
 
    public TreeNode(String name) {
        this.name = name;
        this.children = new ArrayList<>();
    }
 
    public void addChild(TreeNode child) {
            children.add(child);
 
    }
 
 
}