From: qiaowei Date: Tue, 24 Sep 2019 09:33:23 +0000 (+0800) Subject: 添加测试代码 X-Git-Tag: 1.0.1^2~7 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=4f6409f0070e7f70bc563ece4900837dcd25d863;p=epayment%2Ffood_payapi.git 添加测试代码 --- diff --git a/payapi/src/main/kotlin/com/supwisdom/dlpay/mobile/MobileApi.kt b/payapi/src/main/kotlin/com/supwisdom/dlpay/mobile/MobileApi.kt index 4f38c76a..6e2de3cb 100644 --- a/payapi/src/main/kotlin/com/supwisdom/dlpay/mobile/MobileApi.kt +++ b/payapi/src/main/kotlin/com/supwisdom/dlpay/mobile/MobileApi.kt @@ -99,6 +99,7 @@ class ApiInit { val code = RandomUtils.randomNumber(6) logger.error { code } //TODO 先发送成功,再放入redis + redisTemplate.opsForValue().set(phone, code, Duration.ofMinutes(5)) val rs = mobileApiService.sendSms(phone, code) if ("0" != rs.retcode) { return JsonResult.error(rs.retmsg) @@ -330,6 +331,9 @@ class ApiV1 { val temp = redisTemplate.opsForValue().get(user.phone!!) if (temp.isNullOrEmpty()) { val code = RandomUtils.randomNumber(6) + logger.error { code } + //TODO delete it in product + redisTemplate.opsForValue().set(user.loginid, code, Duration.ofMinutes(5)) val rs = mobileApiService.sendSms(user.phone!!, code) if ("0" != rs.retcode) { return JsonResult.error(rs.retmsg)