|
|
|
@ -2,9 +2,11 @@ package com.taxi.apidriver.service;
|
|
|
|
|
|
|
|
|
|
import com.internal.contant.CommonStatusEnum;
|
|
|
|
|
import com.internal.contant.DriverCarConstant;
|
|
|
|
|
import com.internal.contant.IdentityConstant;
|
|
|
|
|
import com.internal.dto.ResponseResult;
|
|
|
|
|
import com.internal.response.DriverUserExistsResponse;
|
|
|
|
|
import com.internal.response.NumberResponse;
|
|
|
|
|
import com.internal.util.RedisPrefixUtils;
|
|
|
|
|
import com.taxi.apidriver.remote.ServiceDriverUserClient;
|
|
|
|
|
import com.taxi.apidriver.remote.ServiceVerificationcodeClient;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
@ -12,6 +14,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
@Slf4j
|
|
|
|
@ -42,10 +46,13 @@ public class VerficationCodeService {
|
|
|
|
|
ResponseResult<NumberResponse> numberResponse = serviceVerificationcodeClient.getVerificationCode(6);
|
|
|
|
|
int numberCode = numberResponse.getData().getNumberCode();
|
|
|
|
|
log.info("验证码"+numberCode);
|
|
|
|
|
//调用三方,获取验证码
|
|
|
|
|
//调用三方,获取验证码,第三方,阿里服务,腾讯,华信
|
|
|
|
|
|
|
|
|
|
//存入redis
|
|
|
|
|
// stringRedisTemplate.opsForValue().set(key, numberCode + "", 5, TimeUnit.MINUTES);
|
|
|
|
|
String numberCodeKey = RedisPrefixUtils.getVerificationCodePrefixKey(driverPhone,
|
|
|
|
|
IdentityConstant.DRIVER_IDENTITY);
|
|
|
|
|
stringRedisTemplate.opsForValue().set(numberCodeKey, numberCode + "",
|
|
|
|
|
5, TimeUnit.MINUTES);
|
|
|
|
|
return ResponseResult.success();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|