41 lines
983 B
Java
41 lines
983 B
Java
package com.ruoyi.device.controller.convert;
|
|
|
|
import com.ruoyi.device.api.domain.DeviceTempVO;
|
|
import com.ruoyi.device.api.domain.DockVO;
|
|
import com.ruoyi.device.service.dto.DeviceTempDTO;
|
|
import com.ruoyi.device.service.dto.DockDetailDTO;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class DockVOControllerConvert {
|
|
|
|
/**
|
|
* DTO 转 API Domain
|
|
*/
|
|
public static DockVO toVO(DockDetailDTO source)
|
|
{
|
|
if (source == null)
|
|
{
|
|
return null;
|
|
}
|
|
DockVO target = new DockVO();
|
|
BeanUtils.copyProperties(source, target);
|
|
return target;
|
|
}
|
|
|
|
|
|
/**
|
|
* DTO List 转 API Domain List
|
|
*/
|
|
public static List<DockVO> toVOList(List<DockDetailDTO> sources)
|
|
{
|
|
if (sources == null)
|
|
{
|
|
return null;
|
|
}
|
|
return sources.stream().map(DockVOControllerConvert::toVO).collect(Collectors.toList());
|
|
}
|
|
}
|