package com.chushang.system.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.alibaba.spring.util.BeanUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chushang.system.entity.dto.UserQcCodeDTO;
import com.chushang.system.entity.po.SysRoleDept;
import com.chushang.system.entity.po.SysUserQcCode;
import com.chushang.system.mapper.SysRoleDeptMapper;
import com.chushang.system.mapper.SysUserQcCodeMapper;
import com.chushang.system.service.ISysRoleDeptService;
import com.chushang.system.service.ISysUserQcCodeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2022-08-18
 */
@Slf4j
@Service
public class SysUserQcCodeServiceImpl extends ServiceImpl<SysUserQcCodeMapper, SysUserQcCode> implements ISysUserQcCodeService {

    @Override
    public SysUserQcCode getInfo(Long userId) {
        return baseMapper.selectById(userId);
    }

    @Override
    public int save(UserQcCodeDTO userQcCodeDTO) {
        SysUserQcCode sysUserQcCode = new SysUserQcCode();
        sysUserQcCode.setLoanCode(userQcCodeDTO.getUrl());
        userQcCodeDTO.setUserId(userQcCodeDTO.getUserId());
        return baseMapper.insert(sysUserQcCode);
    }
}
