...
|
...
|
@@ -372,33 +372,25 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
|
|
private PhotoCheckResultVO zhiMaCertPhotoCheck(RealNameAuthorizeReqVO reqVO){
|
|
|
//每天:记录一个累加的次数 ,超过一定的数量不允许继续调
|
|
|
String dayStr = getStringDate("yyyyMMdd");
|
|
|
List<ImageBO> ls=new ArrayList<>();
|
|
|
List<ImageBO> imageBoList=new ArrayList<>();
|
|
|
ImageBO frontUploadModel=new ImageBO();
|
|
|
frontUploadModel.setImageSide("front");
|
|
|
frontUploadModel.setImageUrl(signPrivateUrl(reqVO.getFrontImageUrl()));
|
|
|
ls.add(frontUploadModel);
|
|
|
frontUploadModel.setImageUrl(ZhiMaCallUtil.signPrivateUrl(reqVO.getFrontImageUrl()));
|
|
|
imageBoList.add(frontUploadModel);
|
|
|
|
|
|
//不再校验反面
|
|
|
/*
|
|
|
ImageBO backUploadModel=new ImageBO();
|
|
|
backUploadModel.setImageSide("back");
|
|
|
backUploadModel.setImageUrl(signPrivateUrl(reqVO.getBackImageUrl()));
|
|
|
ls.add(backUploadModel);
|
|
|
imageBoList.add(backUploadModel);
|
|
|
*/
|
|
|
|
|
|
//调用接口,ocr验证
|
|
|
PhotoCheckResultVO certPhotoCheckResult = checkCertPhoto(dayStr,ls ,reqVO);
|
|
|
PhotoCheckResultVO certPhotoCheckResult = checkCertPhoto(dayStr,imageBoList ,reqVO);
|
|
|
return certPhotoCheckResult;
|
|
|
}
|
|
|
|
|
|
private String signPrivateUrl(String imgUrl){
|
|
|
//获取加载凭证后的url
|
|
|
String accessKey = "BwWhoJN536BnV3CzlE20AjNKC9O2bP0l5tFpKsDU";
|
|
|
String secretKey = "_x2VtO7fEmylgjojmLi7qwTBtRm30S8BrO0FxOPK";
|
|
|
Auth auth = Auth.create(accessKey,secretKey);
|
|
|
String downloadUrl = auth.privateDownloadUrl(imgUrl);
|
|
|
return downloadUrl;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 调用通用的图片验证ocr
|
...
|
...
|
@@ -428,7 +420,7 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { |
|
|
long num = cacheService.incrementPhotoCheckCount(dayStr,reqVO.getUid());
|
|
|
logger.info("checkCertPhoto call begin reqVO {} ,call redis count {}",reqVO, num);
|
|
|
|
|
|
Response<ImageReviewResp> imageReviewRespResponse =ocrCertPhotoService.ocrCheck(reqVO,imageBOList);
|
|
|
Response<ImageReviewResp> imageReviewRespResponse =ocrCertPhotoService.ocrCheck(reqVO.getUid(),imageBOList);
|
|
|
logger.info("checkCertPhoto call end reqVO {} ,resp {} ",reqVO,JSON.toJSONString(imageReviewRespResponse));
|
|
|
|
|
|
if(imageReviewRespResponse==null||imageReviewRespResponse.getCode()!=200){
|
...
|
...
|
|