a-tuoheng-device/src/main/java/com/ruoyi/device/service/convert/DeviceServiceConvert.java

57 lines
1.2 KiB
Java
Raw Normal View History

2026-01-16 19:38:06 +08:00
package com.ruoyi.device.service.convert;
2026-01-21 11:14:31 +08:00
import com.ruoyi.common.core.utils.BaseConvert;
2026-01-16 19:38:06 +08:00
import com.ruoyi.device.domain.model.Device;
import com.ruoyi.device.service.dto.DeviceDTO;
import java.util.List;
/**
* 设备Service层转换器
* Service DTO Domain Model
*
* @author ruoyi
* @date 2026-01-16
*/
2026-01-21 11:14:31 +08:00
public class DeviceServiceConvert extends BaseConvert<Device, DeviceDTO>
2026-01-16 19:38:06 +08:00
{
2026-01-21 11:14:31 +08:00
private static final DeviceServiceConvert INSTANCE = new DeviceServiceConvert();
private DeviceServiceConvert() {
super(Device.class, DeviceDTO.class);
}
2026-01-16 19:38:06 +08:00
/**
* Model DTO
*/
2026-01-21 11:14:31 +08:00
public static DeviceDTO from(Device model)
2026-01-16 19:38:06 +08:00
{
2026-01-21 11:14:31 +08:00
return INSTANCE.innerFrom(model);
2026-01-16 19:38:06 +08:00
}
/**
* DTO Model
*/
2026-01-21 11:14:31 +08:00
public static Device to(DeviceDTO dto)
2026-01-16 19:38:06 +08:00
{
2026-01-21 11:14:31 +08:00
return INSTANCE.innerTo(dto);
2026-01-16 19:38:06 +08:00
}
/**
* Model List DTO List
*/
2026-01-21 11:14:31 +08:00
public static List<DeviceDTO> fromList(List<Device> modelList)
{
return INSTANCE.innerFromList(modelList);
}
/**
* DTO List Model List
*/
public static List<Device> toList(List<DeviceDTO> dtoList)
2026-01-16 19:38:06 +08:00
{
2026-01-21 11:14:31 +08:00
return INSTANCE.innerToList(dtoList);
2026-01-16 19:38:06 +08:00
}
2026-01-21 11:14:31 +08:00
2026-01-16 19:38:06 +08:00
}