36 lines
879 B
Java
36 lines
879 B
Java
package com.ruoyi.device.controller.convert;
|
|
|
|
import com.ruoyi.device.api.domain.PayloadDetailVO;
|
|
import com.ruoyi.device.service.dto.PayloadDTO;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class PlayloadControllerConvert {
|
|
|
|
public static List<PayloadDetailVO> toList(List<PayloadDTO> payloadDTOList)
|
|
{
|
|
if (payloadDTOList == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return payloadDTOList.stream()
|
|
.map(PlayloadControllerConvert::to)
|
|
.collect(Collectors.toList());
|
|
}
|
|
|
|
public static PayloadDetailVO to(PayloadDTO source)
|
|
{
|
|
if (source == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
PayloadDetailVO target = new PayloadDetailVO();
|
|
BeanUtils.copyProperties(source, target);
|
|
return target;
|
|
}
|
|
}
|