package com.ruoyi.ss.vipLevel.service.impl;

import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.ss.vipLevel.domain.VipLevel;
import com.ruoyi.ss.vipLevel.domain.VipLevelVO;
import com.ruoyi.ss.vipLevel.service.VipLevelConverter;
import org.springframework.stereotype.Service;

@Service
public class VipLevelConverterImpl implements VipLevelConverter {

    @Override
    public VipLevel toPoByMchEdit(VipLevelVO data) {
        if (data == null) {
            return null;
        }

        VipLevel po = new VipLevel();
        // 商户id
        po.setMchId(SecurityUtils.getUserId());
        // 其他数据
        po.setId(data.getId());
        po.setPrice(data.getPrice());
        po.setTime(data.getTime());
        po.setDescription(data.getDescription());
        po.setLimitType(data.getLimitType());
        po.setLimitCount(data.getLimitCount());
        po.setStatus(data.getStatus());
        po.setName(data.getName());
        po.setOriginalPrice(data.getOriginalPrice());
        po.setLimitTotal(data.getLimitTotal());
        po.setDiscount(data.getDiscount());
        po.setStoreId(data.getStoreId());

        return po;
    }
}
