package com.hssx.pcbms.util;

import java.util.Random;

/**
 * Author: 吴涛涛 cuiyi@itany.com
 * Date : 2019 - 10 - 24 16:23
 * Description:验证码生成工具
 * Version: 1.0
 */
public class CodeUtil {


    public HttpRespMsg getVcode(String mobile) {
        HttpRespMsg msg = new HttpRespMsg();
        if (mobile != null) {
            Random r = new Random();
            int val = r.nextInt(10000);
            if (val < 1000) {
                val += 1000;
            }
            String codeValStr = ""+val;
//            Vcode record = new Vcode();
//            record.setMobile(mobile);
//            record.setVcode("" + val);
//            vcodeMapper.insertSelective(record);
//            try {
//                SendSmsResponse sendSmsResponse = SmsDemo.sendSms(mobile, record.getVcode());
//            } catch (ClientException e) {
//                e.printStackTrace();
//            }
        }
        return msg;
    }
}
