2026-01-16 19:13:33 +08:00
|
|
|
package com.ruoyi.device.domain.convert;
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.device.domain.model.DockAircraft;
|
|
|
|
|
import com.ruoyi.device.mapper.entity.DockAircraftEntity;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 机场无人机关联Domain层转换器
|
|
|
|
|
* Domain Model ↔ Mapper Entity
|
|
|
|
|
*
|
|
|
|
|
* @author ruoyi
|
|
|
|
|
* @date 2026-01-16
|
|
|
|
|
*/
|
2026-01-20 17:05:25 +08:00
|
|
|
public class DockAircraftDomainEntityConvert
|
2026-01-16 19:13:33 +08:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Entity 转 Model
|
|
|
|
|
*/
|
|
|
|
|
public static DockAircraft toModel(DockAircraftEntity entity)
|
|
|
|
|
{
|
|
|
|
|
if (entity == null)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
DockAircraft model = new DockAircraft();
|
|
|
|
|
BeanUtils.copyProperties(entity, model);
|
|
|
|
|
return model;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Model 转 Entity
|
|
|
|
|
*/
|
|
|
|
|
public static DockAircraftEntity toEntity(DockAircraft model)
|
|
|
|
|
{
|
|
|
|
|
if (model == null)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
DockAircraftEntity entity = new DockAircraftEntity();
|
|
|
|
|
BeanUtils.copyProperties(model, entity);
|
|
|
|
|
return entity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Entity List 转 Model List
|
|
|
|
|
*/
|
|
|
|
|
public static List<DockAircraft> toModelList(List<DockAircraftEntity> entityList)
|
|
|
|
|
{
|
|
|
|
|
if (entityList == null)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2026-01-20 17:05:25 +08:00
|
|
|
return entityList.stream().map(DockAircraftDomainEntityConvert::toModel).collect(Collectors.toList());
|
2026-01-16 19:13:33 +08:00
|
|
|
}
|
|
|
|
|
}
|