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

import com.ruoyi.bst.store.domain.Store;
import com.ruoyi.bst.store.service.StoreConverter;
import org.springframework.stereotype.Service;

@Service
public class StoreConverterImpl implements StoreConverter {
    @Override
    public Store toPoByCreate(Store data) {
        if (data == null) {
            return null;
        }
        Store po = new Store();
        // 设置基本信息
        po.setStoreName(data.getStoreName());
        po.setUserName(data.getUserName());
        po.setPhone(data.getPhone());
        po.setStartTime(data.getStartTime());
        po.setEndTime(data.getEndTime());
        po.setProvince(data.getProvince());
        po.setCity(data.getCity());
        po.setCounty(data.getCounty());
        po.setPicture(data.getPicture());
        return po;
    }

    @Override
    public Store toPoByUpdate(Store data) {
        if (data == null) {
            return null;
        }
        Store po = new Store();
        // 设置基本信息
        po.setStoreId(data.getStoreId());
        po.setStoreName(data.getStoreName());
        po.setUserName(data.getUserName());
        po.setPhone(data.getPhone());
        po.setStartTime(data.getStartTime());
        po.setEndTime(data.getEndTime());
        po.setProvince(data.getProvince());
        po.setCity(data.getCity());
        po.setCounty(data.getCounty());
        return po;
    }
}
