package com.ruoyi.system.domain.resp;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.core.domain.entity.SysDept;
import lombok.Builder;
import lombok.Data;

import java.util.List;

/**
 * 前端select
 */
@Data
@Builder
public class RespTreeSelect {

    private Long id;

    private String label;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<RespTreeSelect> children;

    public RespTreeSelect() {
    }

    public RespTreeSelect(Long id, String label, List<RespTreeSelect> children) {
        this.id = id;
        this.label = label;
        this.children = children;
    }

    public RespTreeSelect(SysDept dept){
        this.id=dept.getDeptId();
        this.label=dept.getDeptName();
    }
}
