2026-01-16 19:13:33 +08:00
|
|
|
package com.ruoyi.device.domain.convert;
|
|
|
|
|
|
2026-01-21 10:21:20 +08:00
|
|
|
import com.ruoyi.common.core.utils.BaseConvert;
|
2026-01-16 19:13:33 +08:00
|
|
|
import com.ruoyi.device.domain.model.Device;
|
|
|
|
|
import com.ruoyi.device.mapper.entity.DeviceEntity;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设备Domain层转换器
|
|
|
|
|
* Domain Model ↔ Mapper Entity
|
|
|
|
|
*
|
|
|
|
|
* @author ruoyi
|
|
|
|
|
* @date 2026-01-16
|
|
|
|
|
*/
|
2026-01-21 13:18:33 +08:00
|
|
|
public class DeviceConvert extends BaseConvert<DeviceEntity, Device> {
|
2026-01-21 10:21:20 +08:00
|
|
|
|
2026-01-21 13:18:33 +08:00
|
|
|
private static final DeviceConvert INSTANCE = new DeviceConvert();
|
2026-01-21 10:21:20 +08:00
|
|
|
|
2026-01-21 13:18:33 +08:00
|
|
|
private DeviceConvert() {
|
2026-01-21 10:21:20 +08:00
|
|
|
super(DeviceEntity.class, Device.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Device from(DeviceEntity entity) {
|
|
|
|
|
return INSTANCE.innerFrom(entity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static DeviceEntity to(Device model) {
|
|
|
|
|
return INSTANCE.innerTo(model);
|
2026-01-16 19:13:33 +08:00
|
|
|
}
|
|
|
|
|
|
2026-01-21 10:21:20 +08:00
|
|
|
public static List<Device> fromList(List<DeviceEntity> entityList) {
|
|
|
|
|
return INSTANCE.innerFromList(entityList);
|
2026-01-16 19:13:33 +08:00
|
|
|
}
|
|
|
|
|
|
2026-01-21 10:21:20 +08:00
|
|
|
public static List<DeviceEntity> toList(List<Device> modelList) {
|
|
|
|
|
return INSTANCE.innerToList(modelList);
|
2026-01-16 19:13:33 +08:00
|
|
|
}
|
|
|
|
|
}
|