|
|
package com.yohoufo.user.controller.passport;
|
|
|
|
|
|
|
|
|
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;
|
...
|
...
|
@@ -32,6 +33,9 @@ public class RealNameAuthorizeController { |
|
|
|
|
|
private final String yohoCardUrlPre= "http://yhgidcard.static.yhbimg.com/yohocard";
|
|
|
|
|
|
@Autowired
|
|
|
private ConfigReader configReader;
|
|
|
|
|
|
/*@Autowired
|
|
|
GraphVerifyService graphVerifyService;*/
|
|
|
|
...
|
...
|
@@ -166,6 +170,12 @@ public class RealNameAuthorizeController { |
|
|
@RequestMapping(params = "method=ufo.user.zhiMaCertWithPhotoCheckInit")
|
|
|
public ApiResponse zhiMaCertWithPhotoCheckInit(RealNameAuthorizeReqVO reqVO) throws GatewayException {
|
|
|
logger.info("enter realNameAuthorize.zhiMaCertWithPhotoCheckInit param reqVO is {}", reqVO);
|
|
|
//若版本低于6.9.9提示升级版本
|
|
|
if(configReader.getBoolean("ufo.user.idCertUpdateVersionSwitch",false) && compareVersion(reqVO.getApp_version(), "6.9.9") < 0 ){
|
|
|
logger.info("realNameAuthorize.zhiMaCertWithPhotoCheckInit: version need update, version is {}, uid is {}", reqVO.getApp_version(), reqVO.getUid());
|
|
|
throw new GatewayException(400, "支付宝实名认证服务已升级,请升级有货APP最新版本后重新申请");
|
|
|
}
|
|
|
|
|
|
//(1) 优先校验请求的参数
|
|
|
if (reqVO == null || reqVO.getUid()<=0){
|
|
|
throw new GatewayException(400, "uid不能为空!");
|
...
|
...
|
@@ -251,6 +261,12 @@ public class RealNameAuthorizeController { |
|
|
public ApiResponse zhiMaCertResultQuery(RealNameAuthorizeReqVO reqVO) throws GatewayException {
|
|
|
logger.info("enter realNameAuthorize.zhiMaCertResultQuery param reqVO is {}", reqVO);
|
|
|
|
|
|
//若版本低于6.9.9提示升级版本
|
|
|
if(configReader.getBoolean("ufo.user.idCertUpdateVersionSwitch",false) && compareVersion(reqVO.getApp_version(), "6.9.9") < 0 ){
|
|
|
logger.info("realNameAuthorize.zhiMaCertResultQuery: version need update, version is {}, uid is {}", reqVO.getApp_version(), reqVO.getUid());
|
|
|
throw new GatewayException(400, "支付宝实名认证服务已升级,请升级有货APP最新版本后重新申请");
|
|
|
}
|
|
|
|
|
|
//(1) 优先校验请求的参数
|
|
|
if (reqVO == null || reqVO.getUid()<=0){
|
|
|
throw new GatewayException(400, "参数错误,uid不能为空!");
|
...
|
...
|
@@ -266,4 +282,28 @@ public class RealNameAuthorizeController { |
|
|
return result;
|
|
|
}
|
|
|
|
|
|
private int compareVersion(String curVersion,String sysVersion){
|
|
|
boolean isCurBlank = StringUtils.isBlank(curVersion);
|
|
|
boolean isSysBlank = StringUtils.isBlank(sysVersion);
|
|
|
if(isCurBlank && isSysBlank){
|
|
|
return 0;
|
|
|
}
|
|
|
if(isCurBlank){
|
|
|
return -1;
|
|
|
}
|
|
|
if(isSysBlank){
|
|
|
return 1;
|
|
|
}
|
|
|
String[] curArr = curVersion.split("\\.");
|
|
|
String[] sysArr = sysVersion.split("\\.");
|
|
|
for(int i=0;i<3;i++){
|
|
|
int cur = Integer.parseInt(curArr[i]);
|
|
|
int sys = Integer.parseInt(sysArr[i]);
|
|
|
if(cur != sys){
|
|
|
return cur-sys;
|
|
|
}
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|