package com.heketai.website.entity.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
 * @author xjl
 */
@Data
public class TreeNode {
    @ApiModelProperty("id")
    protected int id;
    @ApiModelProperty("父id")
    protected int parentId;
    @ApiModelProperty("名称")
    protected String name;
    @ApiModelProperty("子节点")
    protected List<TreeNode> children = new ArrayList<>();

    public void add(TreeNode node) {
        children.add(node);
    }
}

