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

import com.ruoyi.common.core.domain.entity.SmUser;
import com.ruoyi.ss.user.service.UserConverter;
import org.springframework.stereotype.Service;

/**
 * @author wjh
 * 2024/10/15
 */
@Service
public class UserConverterImpl implements UserConverter {
    @Override
    public SmUser toUserSettingByApp(SmUser data) {
        if (data == null) {
            return null;
        }
        SmUser po = new SmUser();
        po.setUserId(data.getUserId());
        po.setAgentDeviceService(data.getAgentDeviceService());
        return po;
    }

    @Override
    public SmUser toPo(SmUser data) {
        if (data == null) {
            return null;
        }

        SmUser po = new SmUser();
        po.setUserId(data.getUserId());
        po.setUserName(data.getUserName());
        po.setNickName(data.getNickName());
        po.setEmail(data.getEmail());
        po.setPhonenumber(data.getPhonenumber());
        po.setAvatar(data.getAvatar());
        po.setPassword(data.getPassword());
        po.setServiceRate(data.getServiceRate());
        po.setDeviceAdmin(data.getDeviceAdmin());
        po.setServiceType(data.getServiceType());
        po.setWithdrawServiceType(data.getWithdrawServiceType());
        po.setWithdrawServiceRate(data.getWithdrawServiceRate());
        po.setLimitWithdraw(data.getLimitWithdraw());
        po.setLimitWithdrawReason(data.getLimitWithdrawReason());
        po.setLimitRefund(data.getLimitRefund());
        po.setLimitRefundReason(data.getLimitRefundReason());
        po.setLimitWithdrawTime(data.getLimitWithdrawTime());
        po.setType(data.getType());
        po.setAgentServiceRate(data.getAgentServiceRate());
        po.setArrivalDelay(data.getArrivalDelay());
        po.setLimitRefundTime(data.getLimitRefundTime());
        po.setShowBillMobile(data.getShowBillMobile());
        po.setShowBillMobilePrice(data.getShowBillMobilePrice());
        po.setAgentDeviceService(data.getAgentDeviceService());
        po.setAgentAllowMchSwitch(data.getAgentAllowMchSwitch());
        po.setChannelIds(data.getChannelIds());
        po.setRemark(data.getRemark());

        return po;
    }
}
