package com.jzdsh.auto.biz;

import com.jzdsh.auto.model.SmsLog;
import lombok.extern.log4j.Log4j2;

import java.util.Date;

/**
 * @ProjectName: auto
 * @Package: com.jzdsh.auto.biz
 * @ClassName: SmsLogService
 * @Author: Jzdsh
 * @Description: 验证码日志表
 * @Date: 2020/3/24 19:15
 * @Version: 1.0
 */
@Log4j2
public class SmsLogService {


    public void saveLog(Integer userId, String nickName, String code) {
        try {
            SmsLog smsLog = new SmsLog( );
            smsLog.setUserId(userId);
            smsLog.setUserName(nickName);
            smsLog.setTitle("短信验证");
            smsLog.setContent("【附近养车网】验证码：" + code + "，您正在验证手机号，若非本人操作，请忽略！");
            smsLog.setCode(code);
            smsLog.setCreatTime(new Date( ));
            smsLog.save( );
        } catch (Exception e) {
            log.info("", e);
        }
    }
}
