diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/controller/BizShortMessageController.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/controller/BizShortMessageController.java index ed80945..34560a6 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/controller/BizShortMessageController.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/controller/BizShortMessageController.java @@ -2,7 +2,7 @@ package com.chinaunicom.mall.ebtp.extend.shortmessage.controller; import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse; -import com.chinaunicom.mall.ebtp.extend.shortmessage.entity.SmsSendRequest; +import com.chinaunicom.mall.ebtp.extend.shortmessage.entity.AuthCodeVo; import com.chinaunicom.mall.ebtp.extend.shortmessage.utils.RSA; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; @@ -16,7 +16,6 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import javax.annotation.Resource; import javax.validation.Valid; -import java.nio.charset.StandardCharsets; import java.util.List; import com.chinaunicom.mall.ebtp.extend.shortmessage.entity.BizShortMessage; import com.chinaunicom.mall.ebtp.extend.shortmessage.service.BizShortMessageService; @@ -43,10 +42,10 @@ public class BizShortMessageController{ * authCode 验证码 * callbackUrl UrlEncode编码 应用系统回调确认用户有效性的地址,应用系统传了这个地址则用户有效性由该地址确定 */ - @GetMapping("/send/authCode") - public BaseResponse authCodeSend(@RequestParam(name = "mobile") String mobile){ - log.info("解密前:"+mobile); - String value = RSA.decrypt(mobile,privateKey); + @PostMapping("/send/authCode") + public BaseResponse authCodeSend(@RequestBody AuthCodeVo vo){ + log.info("解密前:"+vo.getMobile()); + String value = RSA.decrypt(vo.getMobile(),privateKey); log.info("解密后:"+value); return BaseResponse.success(iBizShortMessageService.authCodeSend(value)); } @@ -61,13 +60,12 @@ public class BizShortMessageController{ * authCode 验证码 * callbackUrl UrlEncode编码 应用系统回调确认用户有效性的地址,应用系统传了这个地址则用户有效性由该地址确定 */ - @GetMapping("/check/authCode") - public BaseResponse authCodeCheck(@RequestParam(name = "mobile")String mobile, - @RequestParam(name = "authCode") String authCode){ - log.info("解密前:"+mobile); - String value = RSA.decrypt(mobile,privateKey); + @PostMapping("/check/authCode") + public BaseResponse authCodeCheck(@RequestBody AuthCodeVo vo){ + log.info("解密前:"+vo.getMobile()); + String value = RSA.decrypt(vo.getMobile(),privateKey); log.info("解密后:"+value); - return BaseResponse.success(iBizShortMessageService.authCodeCheck(value, authCode)); + return BaseResponse.success(iBizShortMessageService.authCodeCheck(value, vo.getAuthCode())); } /** diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/entity/AuthCodeVo.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/entity/AuthCodeVo.java new file mode 100644 index 0000000..d469113 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/entity/AuthCodeVo.java @@ -0,0 +1,9 @@ +package com.chinaunicom.mall.ebtp.extend.shortmessage.entity; + +import lombok.Data; + +@Data +public class AuthCodeVo { + private String mobile; + private String authCode; +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/service/impl/BizShortMessageServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/service/impl/BizShortMessageServiceImpl.java index 7092430..9aafd34 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/service/impl/BizShortMessageServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/service/impl/BizShortMessageServiceImpl.java @@ -98,6 +98,7 @@ public class BizShortMessageServiceImpl extends BaseServiceImpl query = new QueryWrapper<>(new BizShortMessage().setId(userId.toString()).setMobile(mobile)); BizShortMessage message = this.getBaseMapper().selectOne(query); Object value = redisTemplate.opsForValue().get("user:" + mobile);