Authored by 匡佳华

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

package com.yohoufo.user.controller.certification;
import com.yoho.core.config.ConfigReader;
import com.yoho.tools.common.beans.ApiResponse;
import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO;
import com.yohoufo.common.exception.GatewayException;
... ... @@ -36,9 +37,16 @@ public class CertificationController {
@Autowired
private ICertificationService certificationService;
@Autowired
private ConfigReader configReader;
@RequestMapping(params = "method=ufo.user.alipayCertification")
public ApiResponse alipayCertification(RealNameAuthorizeReqVO reqVO) throws GatewayException {
logger.info("CertificationController.alipayCertification: Enter alipayCertification param reqVO is {}", reqVO);
//若版本低于6.9.9, 提示升级版本
if(configReader.getBoolean("ufo.user.idCertUpdateVersionSwitch",false) && reqVO.getApp_version().compareTo("6.9.9") < 0){
throw new VersionNotSupportException();
}
//(1) 必要参数的校验
if(reqVO == null || reqVO.getUid() <= 0){
throw new GatewayException(400, "uid不能为空!");
... ... @@ -66,6 +74,10 @@ public class CertificationController {
@RequestMapping(params = "method=ufo.user.alipayCertifyResultQuery")
public ApiResponse alipayCertifyResultQuery(RealNameAuthorizeReqVO reqVO) throws GatewayException {
logger.info("CertificationController.alipayCertifyResultQuery: Enter. RealNameAuthorizeReqVO is {}", reqVO);
//若版本低于6.9.9提示升级版本
if(configReader.getBoolean("ufo.user.idCertUpdateVersionSwitch",false) && reqVO.getApp_version().compareTo("6.9.9") < 0){
throw new VersionNotSupportException();
}
//(1) 校验请求的参数
if (reqVO == null || StringUtils.isBlank(reqVO.getZhiMaBizNo())){
throw new GatewayException(400, "参数错误,zhiMaBizNo不能为空!");
... ...
... ... @@ -39,4 +39,7 @@ ufo.order.seller.hkAccountSettlementEmailTo=xiuchun.luo@yoho.cn
ufo.order.seller.noticeHKSellerEmailTo=chao.chen@yoho.cn,xiuchun.luo@yoho.cn
#实名认证开关
ufo.user.idCertSwitch=false
\ No newline at end of file
ufo.user.idCertSwitch=false
#实名认证提示版本升级开关
ufo.user.idCertUpdateVersionSwitch = true
\ No newline at end of file
... ...