package com.ruoyi.business.domain.vo;

import com.ruoyi.business.domain.ServiceBase;
import com.ruoyi.common.core.domain.TreeSelectCommon;

import java.util.stream.Collectors;

/**
 * 基础服务树VO
 */
public class ServiceBaseVo extends TreeSelectCommon {
    public ServiceBaseVo(ServiceBase serviceBase)
    {
        super.setId(serviceBase.getId());
        super.setLabel(serviceBase.getName());
        super.setDirOrContent(serviceBase.getDirOrContent());
        super.setChildren(serviceBase.getChildren().stream().map(ServiceBaseVo::new).collect(Collectors.toList()));
    }
}
