package com.ruoyi.bst.device.service.impl;

import com.ruoyi.bst.device.domain.Device;
import com.ruoyi.bst.device.service.DeviceConverter;
import com.ruoyi.bst.model.domain.Model;
import com.ruoyi.bst.model.service.ModelConverter;
import org.springframework.stereotype.Service;

@Service
public class DeviceConverterImpl implements DeviceConverter {
    @Override
    public Device toPoByCreate(Device data) {
        if (data == null) {
            return null;
        }
        Device po = new Device();
        // 设置基本信息
        po.setModelId(data.getModelId());
        po.setDeviceName(data.getDeviceName());
        po.setMac(data.getMac());
        po.setMac2(data.getMac2());
        po.setDeviceNo(data.getDeviceNo());
        po.setCustomPicture(data.getCustomPicture());
        po.setRemark(data.getRemark());
        return po;
    }

    @Override
    public Device toPoByUpdate(Device data) {
        if (data == null) {
            return null;
        }
        Device po = new Device();
        // 设置基本信息
        po.setDeviceId(data.getDeviceId());
        po.setModelId(data.getModelId());
        po.setBoothId(data.getBoothId());
        po.setDeviceName(data.getDeviceName());
        po.setMac(data.getMac());
        po.setMac2(data.getMac2());
        po.setDeviceNo(data.getDeviceNo());
        po.setCustomPicture(data.getCustomPicture());
        po.setRemark(data.getRemark());
        return po;
    }
}
