package cn.iocoder.yudao.module.system.api.service;

import cn.hutool.core.bean.BeanUtil;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import cn.iocoder.yudao.module.system.dal.dataobject.service.ServicePackageDO;
import cn.iocoder.yudao.module.system.service.service.ServicePackageService;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 查租户服务的接口实现
 *
 * @author 小李
 * @date 10:39 2024/9/24
**/
@Service
public class ServicePackageApiImpl implements ServicePackageApi{

    @Resource
    @Lazy
    private ServicePackageService servicePackageService;

    /**
     * 查租户服务的详情通过id
     *
     * @author 小李
     * @date 10:37 2024/9/24
     * @param ids ids
     **/
    @Override
    public List<ServicePackageDto> getServicePackageByIds(List<String> ids) {
        List<ServicePackageDO> servicePackageByIds = servicePackageService.getServicePackageByIds(ids);
        return servicePackageByIds.stream().map(item -> BeanUtil.toBean(item, ServicePackageDto.class)).collect(Collectors.toList());
    }
}
