ocr添加请求日志
This commit is contained in:
@@ -18,6 +18,7 @@ import org.springblade.thirdparty.ocr.pojo.dto.*;
|
||||
import org.springblade.thirdparty.ocr.pojo.vo.*;
|
||||
import org.springblade.thirdparty.ocr.service.IOCRService;
|
||||
import org.springblade.thirdparty.ocr.util.ConvertUtil;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@@ -44,6 +45,9 @@ public class OCRServiceImpl implements IOCRService {
|
||||
private final IOCRClient client;
|
||||
private final IOCROtherClient otherClient;
|
||||
|
||||
@Value("${thirdParty.ocr.baseOtherUrl}")
|
||||
private String ocrBaseOtherUrl;
|
||||
|
||||
@Override
|
||||
public TransportCertificateVO recognitionTransportCertificate(CertificateBatchRecognitionDTO param) {
|
||||
log.info("ocr 批量识别参数:{}", JSONUtil.toJsonStr(param));
|
||||
@@ -340,6 +344,8 @@ public class OCRServiceImpl implements IOCRService {
|
||||
for (String url : urls) {
|
||||
OCRCardBankDetRecDTO param = new OCRCardBankDetRecDTO(url);
|
||||
// param.setDataType("IDCard-Main");
|
||||
log.info("调用ocr证件定位+结构化信息提取接口,请求地址:{},请求参数:{}",
|
||||
getCardBankDetRecUrl(), JSONUtil.toJsonStr(param));
|
||||
OCRResultVO<OCRBigCommonCardVO> resultVO = otherClient.cardBankDetRec(param);
|
||||
if (resultVO != null && OCRConstant.SUCCESS_CODE.equals(resultVO.getCode())) {
|
||||
// 成功
|
||||
@@ -360,6 +366,10 @@ public class OCRServiceImpl implements IOCRService {
|
||||
return result;
|
||||
}
|
||||
|
||||
private String getCardBankDetRecUrl() {
|
||||
return ocrBaseOtherUrl.replaceAll("/+$", "") + "/CardBankDetRec";
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换身份证
|
||||
* @param result
|
||||
|
||||
Reference in New Issue
Block a user