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

import com.ruoyi.bst.booth.domain.Booth;
import com.ruoyi.bst.booth.service.BoothConverter;
import com.ruoyi.bst.device.domain.Device;
import com.ruoyi.bst.device.service.DeviceConverter;
import org.springframework.stereotype.Service;

@Service
public class BoothConverterImpl implements BoothConverter {
    @Override
    public Booth toPoByCreate(Booth data) {
        if (data == null) {
            return null;
        }
        Booth po = new Booth();
        // 设置基本信息
        po.setPartId(data.getPartId());
        po.setPicture(data.getPicture());
        po.setBoothNo(data.getBoothNo());
        po.setOrderNum(data.getOrderNum());
        return po;
    }

    @Override
    public Booth toPoByUpdate(Booth data) {
        if (data == null) {
            return null;
        }
        Booth po = new Booth();
        // 设置基本信息
        po.setBoothId(data.getBoothId());
        po.setPartId(data.getPartId());
        po.setPicture(data.getPicture());
        po.setBoothNo(data.getBoothNo());
        po.setOrderNum(data.getOrderNum());
        return po;
    }
}
