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

import com.ruoyi.bst.model.domain.Model;
import com.ruoyi.bst.model.domain.ModelVO;
import com.ruoyi.bst.model.service.ModelConverter;
import org.springframework.stereotype.Service;

@Service
public class ModelConverterImpl implements ModelConverter {
    @Override
    public Model toPoByCreate(Model data) {
        if (data == null) {
            return null;
        }
        Model po = new Model();
        po.setModelName(data.getModelName());
        po.setProductId(data.getProductId());
        po.setModelId(data.getModelId());
        po.setTags(data.getTags());
        po.setPicture(data.getPicture());
        po.setRemark(data.getRemark());
        po.setIntroduce(data.getIntroduce());
        return po;
    }

    @Override
    public Model toPoByUpdate(Model data) {
        if (data == null) {
            return null;
        }
        Model po = new Model();
        po.setModelId(data.getModelId());
        po.setModelName(data.getModelName());
        po.setProductId(data.getProductId());
        po.setModelId(data.getModelId());
        po.setTags(data.getTags());
        po.setPicture(data.getPicture());
        po.setRemark(data.getRemark());
        po.setIntroduce(data.getIntroduce());
        return po;
    }
}
