Authored by 匡佳华

增加实名认证版本校验及开关

1 package com.yohoufo.user.controller.certification; 1 package com.yohoufo.user.controller.certification;
2 2
  3 +import com.yoho.core.config.ConfigReader;
3 import com.yoho.tools.common.beans.ApiResponse; 4 import com.yoho.tools.common.beans.ApiResponse;
4 import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO; 5 import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO;
5 import com.yohoufo.common.exception.GatewayException; 6 import com.yohoufo.common.exception.GatewayException;
@@ -36,9 +37,16 @@ public class CertificationController { @@ -36,9 +37,16 @@ public class CertificationController {
36 @Autowired 37 @Autowired
37 private ICertificationService certificationService; 38 private ICertificationService certificationService;
38 39
  40 + @Autowired
  41 + private ConfigReader configReader;
  42 +
39 @RequestMapping(params = "method=ufo.user.alipayCertification") 43 @RequestMapping(params = "method=ufo.user.alipayCertification")
40 public ApiResponse alipayCertification(RealNameAuthorizeReqVO reqVO) throws GatewayException { 44 public ApiResponse alipayCertification(RealNameAuthorizeReqVO reqVO) throws GatewayException {
41 logger.info("CertificationController.alipayCertification: Enter alipayCertification param reqVO is {}", reqVO); 45 logger.info("CertificationController.alipayCertification: Enter alipayCertification param reqVO is {}", reqVO);
  46 + //若版本低于6.9.9, 提示升级版本
  47 + if(configReader.getBoolean("ufo.user.idCertUpdateVersionSwitch",false) && reqVO.getApp_version().compareTo("6.9.9") < 0){
  48 + throw new VersionNotSupportException();
  49 + }
42 //(1) 必要参数的校验 50 //(1) 必要参数的校验
43 if(reqVO == null || reqVO.getUid() <= 0){ 51 if(reqVO == null || reqVO.getUid() <= 0){
44 throw new GatewayException(400, "uid不能为空!"); 52 throw new GatewayException(400, "uid不能为空!");
@@ -66,6 +74,10 @@ public class CertificationController { @@ -66,6 +74,10 @@ public class CertificationController {
66 @RequestMapping(params = "method=ufo.user.alipayCertifyResultQuery") 74 @RequestMapping(params = "method=ufo.user.alipayCertifyResultQuery")
67 public ApiResponse alipayCertifyResultQuery(RealNameAuthorizeReqVO reqVO) throws GatewayException { 75 public ApiResponse alipayCertifyResultQuery(RealNameAuthorizeReqVO reqVO) throws GatewayException {
68 logger.info("CertificationController.alipayCertifyResultQuery: Enter. RealNameAuthorizeReqVO is {}", reqVO); 76 logger.info("CertificationController.alipayCertifyResultQuery: Enter. RealNameAuthorizeReqVO is {}", reqVO);
  77 + //若版本低于6.9.9提示升级版本
  78 + if(configReader.getBoolean("ufo.user.idCertUpdateVersionSwitch",false) && reqVO.getApp_version().compareTo("6.9.9") < 0){
  79 + throw new VersionNotSupportException();
  80 + }
69 //(1) 校验请求的参数 81 //(1) 校验请求的参数
70 if (reqVO == null || StringUtils.isBlank(reqVO.getZhiMaBizNo())){ 82 if (reqVO == null || StringUtils.isBlank(reqVO.getZhiMaBizNo())){
71 throw new GatewayException(400, "参数错误,zhiMaBizNo不能为空!"); 83 throw new GatewayException(400, "参数错误,zhiMaBizNo不能为空!");
@@ -40,3 +40,6 @@ ufo.order.seller.noticeHKSellerEmailTo=chao.chen@yoho.cn,xiuchun.luo@yoho.cn @@ -40,3 +40,6 @@ ufo.order.seller.noticeHKSellerEmailTo=chao.chen@yoho.cn,xiuchun.luo@yoho.cn
40 40
41 #实名认证开关 41 #实名认证开关
42 ufo.user.idCertSwitch=false 42 ufo.user.idCertSwitch=false
  43 +
  44 +#实名认证提示版本升级开关
  45 +ufo.user.idCertUpdateVersionSwitch = true