2026-01-16 19:13:33 +08:00
|
|
|
package com.ruoyi.device.domain.convert;
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.device.domain.model.DockGroup;
|
|
|
|
|
import com.ruoyi.device.mapper.entity.DockGroupEntity;
|
|
|
|
|
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 DockGroupDomainEntityConvert
|
2026-01-16 19:13:33 +08:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Entity 转 Model
|
|
|
|
|
*/
|
|
|
|
|
public static DockGroup toModel(DockGroupEntity entity)
|
|
|
|
|
{
|
|
|
|
|
if (entity == null)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
DockGroup model = new DockGroup();
|
|
|
|
|
BeanUtils.copyProperties(entity, model);
|
|
|
|
|
return model;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Model 转 Entity
|
|
|
|
|
*/
|
|
|
|
|
public static DockGroupEntity toEntity(DockGroup model)
|
|
|
|
|
{
|
|
|
|
|
if (model == null)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
DockGroupEntity entity = new DockGroupEntity();
|
|
|
|
|
BeanUtils.copyProperties(model, entity);
|
|
|
|
|
return entity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Entity List 转 Model List
|
|
|
|
|
*/
|
|
|
|
|
public static List<DockGroup> toModelList(List<DockGroupEntity> entityList)
|
|
|
|
|
{
|
|
|
|
|
if (entityList == null)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2026-01-20 17:05:25 +08:00
|
|
|
return entityList.stream().map(DockGroupDomainEntityConvert::toModel).collect(Collectors.toList());
|
2026-01-16 19:13:33 +08:00
|
|
|
}
|
|
|
|
|
}
|