package cn.newfeifan.mall.module.distri.controller.admin.sharepath.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TreeNode {
    private Long userId;
    private String name; // 节点名称
    private String nickname;
    private String phone;
    private Integer deep;
    private Integer value; // 节点值，某些节点可能没有值
    private Long parentId; // 父亲Id
    private Boolean hasSon;
    private Integer sort;
    private List<TreeNode> children; // 子节点列表

    public Boolean getHasSon() {
        if (children == null) {
            return false;
        }
        return !children.isEmpty();
    }
}
