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

import org.springframework.stereotype.Service;

import com.ruoyi.common.core.domain.vo.UserVO;
import com.ruoyi.system.user.service.UserConverter;

@Service
public class UserConverterImpl implements UserConverter {

    @Override
    public UserVO toVOByCreate(UserVO data) {
        if (data == null) {
            return null;
        }
        UserVO vo = new UserVO();
        vo.setUserType(data.getUserType());
        vo.setNickName(data.getNickName());
        vo.setRoleIds(data.getRoleIds());
        vo.setUserName(data.getUserName());
        vo.setPassword(data.getPassword());
        vo.setAgentId(data.getAgentId());
        vo.setPoint(data.getPoint());
        vo.setDeptId(data.getDeptId());
        vo.setEmail(data.getEmail());
        vo.setPhonenumber(data.getPhonenumber());
        vo.setSex(data.getSex());
        vo.setAvatar(data.getAvatar());
        vo.setStatus(data.getStatus());
        vo.setWithdrawServiceType(data.getWithdrawServiceType());
        vo.setWithdrawServiceValue(data.getWithdrawServiceValue());
        vo.setBonusDelay(data.getBonusDelay());
        return vo;
    }

    @Override
    public UserVO toVOByUpdate(UserVO data) {
        if (data == null) {
            return null;
        }
        UserVO vo = new UserVO();
        vo.setUserId(data.getUserId());
        vo.setUserType(data.getUserType());
        vo.setNickName(data.getNickName());
        vo.setRoleIds(data.getRoleIds());
        vo.setUserName(data.getUserName());
        vo.setAgentId(data.getAgentId());
        vo.setPoint(data.getPoint());
        vo.setDeptId(data.getDeptId());
        vo.setEmail(data.getEmail());
        vo.setPhonenumber(data.getPhonenumber());
        vo.setSex(data.getSex());
        vo.setAvatar(data.getAvatar());
        vo.setStatus(data.getStatus());
        vo.setWithdrawServiceType(data.getWithdrawServiceType());
        vo.setWithdrawServiceValue(data.getWithdrawServiceValue());
        vo.setBonusDelay(data.getBonusDelay());
        return vo;
    }
    
    
}
