/*
*  Copyright 2019-2025 Tz
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain.dto;

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

/**
* @author tz
* @date 2025-05-21
**/
@Data
public class BusTreeVo {

    @ApiModelProperty(value = "标识")
    private String id;

    @ApiModelProperty(value = "上级")
    private String pid;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "子节点数目", hidden = true)
    private Integer subCount = 0;

    @ApiModelProperty(value = "标签名称")
    public String getLabel() {
        return name;
    }

    @ApiModelProperty(value = "是否有子节点")
    public Boolean getHasChildren() {
        return subCount > 0;
    }

    @ApiModelProperty(value = "是否为叶子")
    public Boolean getLeaf() {
        return subCount <= 0;
    }

}