jruqhwn
This commit is contained in:
parent
340424f945
commit
66868b1429
@ -13,6 +13,11 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* https://console.bce.baidu.com/support/?_=1740219852952×tamp=1740281560085#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E9%80%9A%E7%94%A8%E5%9C%BA%E6%99%AFOCR&api=rest%2F2.0%2Focr%2Fv1%2Faccurate&method=post
|
||||
*
|
||||
*
|
||||
* 通用文字识别(高精度。。
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
|
||||
@ -19,7 +19,7 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
@Slf4j
|
||||
@CustomPath("accurateBasic")
|
||||
public class AHandwritingHandle extends BaiduBaseHandle<AHandwritingRequest, AHandwritingResp> {
|
||||
public class BHandwritingHandle extends BaiduBaseHandle<AHandwritingRequest, AHandwritingResp> {
|
||||
@Override
|
||||
public String getUri() {
|
||||
return "/rest/2.0/ocr/v1/handwriting";
|
||||
@ -19,7 +19,7 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
@Slf4j
|
||||
@CustomPath("numbers")
|
||||
public class ANumbersHandle extends BaiduBaseHandle<ANumbersRequest, ANumbersResp> {
|
||||
public class BNumbersHandle extends BaiduBaseHandle<ANumbersRequest, ANumbersResp> {
|
||||
@Override
|
||||
public String getUri() {
|
||||
return "/rest/2.0/ocr/v1/numbers";
|
||||
@ -17,7 +17,7 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
@Slf4j
|
||||
@CustomPath("smartStruct")
|
||||
public class ASmartStructHandle extends BaiduBaseHandle<ASmartStructRequest, ASmartStructResp> {
|
||||
public class BSmartStructHandle extends BaiduBaseHandle<ASmartStructRequest, ASmartStructResp> {
|
||||
@Override
|
||||
public String getUri() {
|
||||
return "/rest/2.0/ocr/v1/smart_struct";
|
||||
@ -70,7 +70,7 @@ public class BDocAnalysisOfficeRequest extends BaiduOfdRequest {
|
||||
/**
|
||||
* true/false 是否返回每行识别结果的置信度。默认为false
|
||||
*/
|
||||
private String lineProbability = "false";
|
||||
private String lineProbability = "true";
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -51,7 +51,7 @@ public class BQrcodeReconizeResp extends BBaseResp {
|
||||
@Data
|
||||
public static class CodesResultDTO {
|
||||
/**
|
||||
* 印章的类别,共有circle(圆章),ellipse(椭圆章),rectangle(方章)三种
|
||||
* 识别码类型条码类型包括:9种条形码(UPC_A、UPC_E、EAN_13、EAN_8、CODE_39、CODE_93、CODE_128、ITF、CODABAR),4种二维码(QR_CODE、DATA_MATRIX、AZTEC、PDF_417)
|
||||
*/
|
||||
@JsonProperty("type")
|
||||
private String type;
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
package com.heyu.api.controller.common;
|
||||
|
||||
|
||||
import com.heyu.api.baidu.handle.common.BAccurateBasicHandle;
|
||||
import com.heyu.api.baidu.request.common.BAccurateBasicRequest;
|
||||
import com.heyu.api.baidu.response.common.BAccurateBasicResp;
|
||||
import com.heyu.api.controller.BaseController;
|
||||
import com.heyu.api.data.annotation.CacheResult;
|
||||
import com.heyu.api.data.annotation.NotIntercept;
|
||||
import com.heyu.api.data.utils.ApiR;
|
||||
import com.heyu.api.data.utils.R;
|
||||
import com.heyu.api.resp.common.AccurateBasicResp;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* https://console.bce.baidu.com/support/?_=1740219852952×tamp=1740220055846#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E9%80%9A%E7%94%A8%E5%9C%BA%E6%99%AFOCR&api=rest%2F2.0%2Focr%2Fv1%2Faccurate_basic&method=post
|
||||
* <p>
|
||||
* 通用文字识别(高精度。
|
||||
*
|
||||
*
|
||||
* 接口描述
|
||||
* 在通用文字识别的基础上,提供更高精度的识别服务,支持更多语种识别(丹麦语、荷兰语、马来语、瑞典语、印尼语、波兰语、罗马尼亚语、土耳其语、希腊语、
|
||||
* 匈牙利语、泰语、越语、阿拉伯语、印地语及部分中国少数民族语言),并将字库从1w+扩展到2w+,能识别所有常用字和大部分生僻字。
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/accurateBasic")
|
||||
@NotIntercept
|
||||
public class AccurateBasicController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private BAccurateBasicHandle bAccurateBasicHandle;
|
||||
|
||||
|
||||
@RequestMapping("/recognize")
|
||||
@CacheResult
|
||||
public R recognize(BAccurateBasicRequest request) {
|
||||
|
||||
|
||||
List<AccurateBasicResp> respList = new ArrayList<>();
|
||||
|
||||
|
||||
ApiR<BAccurateBasicResp> bR = bAccurateBasicHandle.handle(request);
|
||||
if (bR.isSuccess()) {
|
||||
BAccurateBasicResp bAccurateBasicResp = bR.getData();
|
||||
|
||||
|
||||
List<BAccurateBasicResp.WordsResultDTO> list = bAccurateBasicResp.getWordsResult();
|
||||
for (BAccurateBasicResp.WordsResultDTO wordsResultDTO : list) {
|
||||
|
||||
AccurateBasicResp resp = new AccurateBasicResp();
|
||||
resp.setWord(wordsResultDTO.getWords());
|
||||
|
||||
respList.add(resp);
|
||||
}
|
||||
|
||||
return R.ok().setData(respList);
|
||||
}
|
||||
|
||||
|
||||
return R.error(bR.getErrorMsg());
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package com.heyu.api.controller.common;
|
||||
|
||||
|
||||
import com.heyu.api.baidu.handle.common.BDocAnalysisOfficeHandle;
|
||||
import com.heyu.api.baidu.request.common.BDocAnalysisOfficeRequest;
|
||||
import com.heyu.api.baidu.response.common.BDocAnalysisOfficeResp;
|
||||
import com.heyu.api.data.annotation.CacheResult;
|
||||
import com.heyu.api.data.annotation.NotIntercept;
|
||||
import com.heyu.api.data.utils.ApiR;
|
||||
import com.heyu.api.data.utils.R;
|
||||
import com.heyu.api.resp.common.DocAnalysisOfficeResp;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/***
|
||||
*
|
||||
*
|
||||
* https://console.bce.baidu.com/support/?_=1740219852952×tamp=1742640527850#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E9%80%9A%E7%94%A8%E5%9C%BA%E6%99%AFOCR&api=rest%2F2.0%2Focr%2Fv1%2Fdoc_analysis_office&method=post
|
||||
*
|
||||
* 办公文档识别
|
||||
*
|
||||
*
|
||||
* 接口描述
|
||||
* 支持对各类办公文档进行版面分析和文字识别,输出图、表、印章、标题等元素及位置信息,并分版块输出文字识别结果。可支持中、英、日、韩、法等 20+ 语言类型,印刷、手写、混排等多种场景。
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/office/doc")
|
||||
@NotIntercept
|
||||
public class DocAnalysisOfficeController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private BDocAnalysisOfficeHandle bDocAnalysisOfficeHandle;
|
||||
|
||||
|
||||
@RequestMapping("/recognize")
|
||||
@CacheResult
|
||||
public R recognize(BDocAnalysisOfficeRequest request) {
|
||||
|
||||
List<DocAnalysisOfficeResp> respList = new ArrayList<>();
|
||||
|
||||
ApiR<BDocAnalysisOfficeResp> br = bDocAnalysisOfficeHandle.handle(request);
|
||||
|
||||
if (br.isSuccess()) {
|
||||
BDocAnalysisOfficeResp bDocAnalysisOfficeResp = br.getData();
|
||||
for (BDocAnalysisOfficeResp.ResultsDTO result : bDocAnalysisOfficeResp.getResults()) {
|
||||
DocAnalysisOfficeResp resp = new DocAnalysisOfficeResp();
|
||||
resp.setWordsType(result.getWordsType());
|
||||
resp.setAverageLineProbability(result.getWords().getLineProbability().getAverage());
|
||||
resp.setMinLineProbability(result.getWords().getLineProbability().getMin());
|
||||
resp.setWord(result.getWords().getWord());
|
||||
respList.add(resp);
|
||||
}
|
||||
return R.ok().setData(respList);
|
||||
}
|
||||
|
||||
|
||||
return R.error(br.getErrorMsg());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package com.heyu.api.controller.common;
|
||||
|
||||
|
||||
import com.heyu.api.baidu.handle.common.BHandwritingHandle;
|
||||
import com.heyu.api.baidu.request.common.AHandwritingRequest;
|
||||
import com.heyu.api.baidu.response.common.AHandwritingResp;
|
||||
import com.heyu.api.data.annotation.CacheResult;
|
||||
import com.heyu.api.data.annotation.NotIntercept;
|
||||
import com.heyu.api.data.utils.ApiR;
|
||||
import com.heyu.api.data.utils.R;
|
||||
import com.heyu.api.resp.common.HandwritingResp;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* https://console.bce.baidu.com/support/?_=1740219852952×tamp=1740295688238#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E9%80%9A%E7%94%A8%E5%9C%BA%E6%99%AFOCR&api=rest%2F2.0%2Focr%2Fv1%2Fhandwriting&method=post
|
||||
* <p>
|
||||
* 手写文字识别
|
||||
*
|
||||
* 接口描述
|
||||
* 支持对各类手写文字进行检测和识别,包括中、英、日、韩、法等 20+ 语言类型,可按单字维度输出置信度、候选字等信息。针对手写作文场景,支持涂改痕迹检测。
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/handwriting")
|
||||
@NotIntercept
|
||||
public class HandwritingController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private BHandwritingHandle aHandwritingHandle;
|
||||
|
||||
|
||||
@RequestMapping("/recognize")
|
||||
@CacheResult
|
||||
public R recognize(AHandwritingRequest request) {
|
||||
|
||||
List<HandwritingResp> respList = new ArrayList<>();
|
||||
|
||||
ApiR<AHandwritingResp> apiR = aHandwritingHandle.handle(request);
|
||||
if (apiR.isSuccess()) {
|
||||
AHandwritingResp aHandwritingResp = apiR.getData();
|
||||
|
||||
List<AHandwritingResp.WordsResultDTO> wordsResultDTOS = aHandwritingResp.getWordsResult();
|
||||
for (AHandwritingResp.WordsResultDTO wordsResultDTO : wordsResultDTOS) {
|
||||
HandwritingResp resp = new HandwritingResp();
|
||||
resp.setWords(wordsResultDTO.getWords());
|
||||
resp.setLeft(wordsResultDTO.getLocation().getLeft());
|
||||
resp.setTop(wordsResultDTO.getLocation().getTop());
|
||||
resp.setWidth(wordsResultDTO.getLocation().getWidth());
|
||||
resp.setHeight(wordsResultDTO.getLocation().getHeight());
|
||||
|
||||
respList.add(resp);
|
||||
|
||||
}
|
||||
return R.ok().setData(respList);
|
||||
}
|
||||
|
||||
|
||||
return R.error();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package com.heyu.api.controller.common;
|
||||
|
||||
|
||||
import com.heyu.api.baidu.handle.common.BNumbersHandle;
|
||||
import com.heyu.api.baidu.request.common.ANumbersRequest;
|
||||
import com.heyu.api.baidu.response.common.ANumbersResp;
|
||||
import com.heyu.api.data.annotation.CacheResult;
|
||||
import com.heyu.api.data.annotation.NotIntercept;
|
||||
import com.heyu.api.data.utils.ApiR;
|
||||
import com.heyu.api.data.utils.R;
|
||||
import com.heyu.api.resp.common.NumbersResp;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* https://console.bce.baidu.com/support/?_=1740219852952×tamp=1740299353970#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E9%80%9A%E7%94%A8%E5%9C%BA%E6%99%AFOCR&api=rest%2F2.0%2Focr%2Fv1%2Fnumbers&method=post
|
||||
* <p>
|
||||
* <p>
|
||||
* 数字识别
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/numbers")
|
||||
@NotIntercept
|
||||
public class NumbersController {
|
||||
|
||||
@Autowired
|
||||
private BNumbersHandle bNumbersHandle;
|
||||
|
||||
@RequestMapping("/recognize")
|
||||
@CacheResult
|
||||
public R recognize(ANumbersRequest request) {
|
||||
|
||||
|
||||
List<NumbersResp> respList = new ArrayList<>();
|
||||
|
||||
ApiR<ANumbersResp> bR = bNumbersHandle.handle(request);
|
||||
|
||||
|
||||
if (bR.isSuccess()) {
|
||||
ANumbersResp aNumbersResp = bR.getData();
|
||||
List<ANumbersResp.WordsResultDTO> wordsResultDTOS = aNumbersResp.getWordsResult();
|
||||
if (CollectionUtils.isNotEmpty(wordsResultDTOS)) {
|
||||
for (ANumbersResp.WordsResultDTO wordsResultDTO : wordsResultDTOS) {
|
||||
NumbersResp resp = new NumbersResp();
|
||||
resp.setWords(wordsResultDTO.getWords());
|
||||
resp.setTop(wordsResultDTO.getLocation().getTop());
|
||||
resp.setLeft(wordsResultDTO.getLocation().getLeft());
|
||||
resp.setHeight(wordsResultDTO.getLocation().getHeight());
|
||||
resp.setWidth(wordsResultDTO.getLocation().getWidth());
|
||||
|
||||
respList.add(resp);
|
||||
}
|
||||
return R.ok().setData(respList);
|
||||
}
|
||||
}
|
||||
return R.error(bR.getErrorMsg());
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package com.heyu.api.controller.common;
|
||||
|
||||
|
||||
import com.heyu.api.baidu.handle.common.BSmartStructHandle;
|
||||
import com.heyu.api.baidu.request.common.ASmartStructRequest;
|
||||
import com.heyu.api.baidu.response.common.ASmartStructResp;
|
||||
import com.heyu.api.controller.BaseController;
|
||||
import com.heyu.api.data.annotation.CacheResult;
|
||||
import com.heyu.api.data.annotation.NotIntercept;
|
||||
import com.heyu.api.data.utils.ApiR;
|
||||
import com.heyu.api.data.utils.R;
|
||||
import com.heyu.api.resp.common.SmartStructResp;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* https://console.bce.baidu.com/support/?_=1740219852952×tamp=1740300649701#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E9%80%9A%E7%94%A8%E5%9C%BA%E6%99%AFOCR&api=rest%2F2.0%2Focr%2Fv1%2Fsmart_struct&method=post
|
||||
* 智能结构化
|
||||
*
|
||||
* 接口描述
|
||||
* 支持智能提取图片中的字段结构化信息,无需训练灵活提取。适用于各类证照、票据、表单等版式中的结构化信息录入场景。
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/smartStruct")
|
||||
@NotIntercept
|
||||
public class SmartStructController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private BSmartStructHandle bSmartStructHandle;
|
||||
|
||||
|
||||
@RequestMapping("/recognize")
|
||||
@CacheResult
|
||||
public R recognize(ASmartStructRequest request) {
|
||||
List<SmartStructResp> respList = new ArrayList<>();
|
||||
ApiR<ASmartStructResp> bR = bSmartStructHandle.handle(request);
|
||||
if (bR.isSuccess()) {
|
||||
ASmartStructResp aSmartStructResp = bR.getData();
|
||||
ASmartStructResp.WordsResultDTO wordsResultDTO = aSmartStructResp.getWordsResult();
|
||||
ASmartStructResp.WordsResultDTO.StructInfoDTO structInfoDTO = wordsResultDTO.getStructInfo();
|
||||
List<ASmartStructResp.WordsResultDTO.StructInfoDTO.GroupDTO> groupDTOS = structInfoDTO.getGroup();
|
||||
for (ASmartStructResp.WordsResultDTO.StructInfoDTO.GroupDTO groupDTO : groupDTOS) {
|
||||
|
||||
SmartStructResp resp = new SmartStructResp();
|
||||
|
||||
for (int i = 0; i < groupDTO.getKey().size(); i++) {
|
||||
ASmartStructResp.WordsResultDTO.StructInfoDTO.GroupDTO.KeyDTO keyDTO = groupDTO.getKey().get(i);
|
||||
ASmartStructResp.WordsResultDTO.StructInfoDTO.GroupDTO.ValueDTO valueDTO = groupDTO.getValue().get(i);
|
||||
resp.setKey(keyDTO.getWord());
|
||||
resp.setValue(valueDTO.getWord());
|
||||
respList.add(resp);
|
||||
}
|
||||
}
|
||||
return R.ok().setData(respList);
|
||||
}
|
||||
return R.error();
|
||||
}
|
||||
}
|
||||
@ -5,12 +5,15 @@ import com.aliyun.ocr20191230.models.RecognizeQrCodeResponse;
|
||||
import com.aliyun.ocr20191230.models.RecognizeQrCodeResponseBody;
|
||||
import com.heyu.api.alibaba.handle.common.text.ARecognizeQrCodeHandle;
|
||||
import com.heyu.api.alibaba.request.common.text.ARecognizeQrCodeRequest;
|
||||
import com.heyu.api.baidu.handle.common.BQrCodeHandle;
|
||||
import com.heyu.api.baidu.request.common.BQrcodeReconizeRequest;
|
||||
import com.heyu.api.baidu.response.common.BQrcodeReconizeResp;
|
||||
import com.heyu.api.controller.BaseController;
|
||||
import com.heyu.api.resp.qrcode.RecognizeQrCodeResp;
|
||||
import com.heyu.api.data.annotation.CacheResult;
|
||||
import com.heyu.api.data.annotation.NotIntercept;
|
||||
import com.heyu.api.data.utils.ApiR;
|
||||
import com.heyu.api.data.utils.R;
|
||||
import com.heyu.api.resp.qrcode.RecognizeQrCodeResp;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -26,6 +29,12 @@ import java.util.List;
|
||||
* 二维码识别
|
||||
*
|
||||
* RecognizeQrCode
|
||||
*
|
||||
*
|
||||
*
|
||||
* https://console.bce.baidu.com/support/?_=1740219852952×tamp=1742644047533#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E9%80%9A%E7%94%A8%E5%9C%BA%E6%99%AFOCR&api=rest%2F2.0%2Focr%2Fv1%2Fqrcode&method=post
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@ -36,11 +45,31 @@ public class RecognizeQrCodeController extends BaseController {
|
||||
@Autowired
|
||||
private ARecognizeQrCodeHandle arecognizeQrCodeHandle;
|
||||
|
||||
|
||||
@Autowired
|
||||
private BQrCodeHandle bqrCodeHandle;
|
||||
|
||||
@RequestMapping("/recognize")
|
||||
@CacheResult
|
||||
public R recognize(ARecognizeQrCodeRequest request) {
|
||||
public R recognize(BQrcodeReconizeRequest request) {
|
||||
RecognizeQrCodeResp resp = new RecognizeQrCodeResp();
|
||||
ApiR<RecognizeQrCodeResponse> aR = arecognizeQrCodeHandle.handle(request);
|
||||
|
||||
ApiR<BQrcodeReconizeResp> bR = bqrCodeHandle.handle(request);
|
||||
if (bR.isSuccess()) {
|
||||
BQrcodeReconizeResp bQrcodeReconizeResp = bR.getData();
|
||||
List<BQrcodeReconizeResp.CodesResultDTO> codesResultDTOS = bQrcodeReconizeResp.getCodesResult();
|
||||
for (BQrcodeReconizeResp.CodesResultDTO codesResultDTO : codesResultDTOS) {
|
||||
resp.setQrCodesData(codesResultDTO.getText());
|
||||
resp.setType(resp.getType());
|
||||
return R.ok().setData(resp);
|
||||
}
|
||||
}
|
||||
|
||||
ARecognizeQrCodeRequest arecognizeQrCodeRequest = new ARecognizeQrCodeRequest();
|
||||
arecognizeQrCodeRequest.setImageBase64(request.getImageBase64());
|
||||
arecognizeQrCodeRequest.setImageUrl(request.getImageUrl());
|
||||
|
||||
ApiR<RecognizeQrCodeResponse> aR = arecognizeQrCodeHandle.handle(arecognizeQrCodeRequest);
|
||||
|
||||
if (aR.isSuccess() && isSuccessStatusCode(aR.getData().getStatusCode())) {
|
||||
RecognizeQrCodeResponse response = aR.getData();
|
||||
@ -59,6 +88,8 @@ public class RecognizeQrCodeController extends BaseController {
|
||||
return R.ok().setData(resp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return R.error();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
package com.heyu.api.resp.common;
|
||||
|
||||
|
||||
import com.heyu.api.data.dto.BaseResp;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AccurateBasicResp extends BaseResp {
|
||||
|
||||
private String word;
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.heyu.api.resp.common;
|
||||
|
||||
import com.heyu.api.data.dto.BaseResp;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class DocAnalysisOfficeResp extends BaseResp {
|
||||
|
||||
/***
|
||||
* 文字属性(手写、印刷),handwriting 手写,print 印刷
|
||||
*/
|
||||
private String wordsType;
|
||||
|
||||
/***
|
||||
* 整行的识别结果数组
|
||||
*/
|
||||
private String word;
|
||||
|
||||
/***
|
||||
*整行中单字的最低置信度
|
||||
*/
|
||||
|
||||
private Double minLineProbability;
|
||||
/***
|
||||
* 行置信度
|
||||
*/
|
||||
private Double averageLineProbability;
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.heyu.api.resp.common;
|
||||
|
||||
import com.heyu.api.data.dto.BaseResp;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class DocAnalysisOfficeWordResp extends BaseResp {
|
||||
|
||||
private String word;
|
||||
|
||||
private Double minLineProbability;
|
||||
|
||||
private Double averageLineProbability;
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.heyu.api.resp.common;
|
||||
|
||||
|
||||
import com.heyu.api.data.dto.BaseResp;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HandwritingResp extends BaseResp {
|
||||
|
||||
private String words; //单字符识别结果的候选词文字
|
||||
private Integer top; // 表示定位位置的长方形左上顶点的垂直坐标
|
||||
private Integer left; // 表示定位位置的长方形左上顶点的水平坐标
|
||||
private Integer width; // 表示定位位置的长方形的宽度
|
||||
private Integer height; // 表示定位位置的长方形的高度
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.heyu.api.resp.common;
|
||||
|
||||
import com.heyu.api.data.dto.BaseResp;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class NumbersResp extends BaseResp {
|
||||
|
||||
|
||||
private String words; //单字符识别结果的候选词文字
|
||||
private Integer top; // 表示定位位置的长方形左上顶点的垂直坐标
|
||||
private Integer left; // 表示定位位置的长方形左上顶点的水平坐标
|
||||
private Integer width; // 表示定位位置的长方形的宽度
|
||||
private Integer height; // 表示定位位置的长方形的高度
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.heyu.api.resp.common;
|
||||
|
||||
|
||||
import com.heyu.api.data.dto.BaseResp;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SmartStructResp extends BaseResp {
|
||||
|
||||
|
||||
private String key ; // key
|
||||
|
||||
private String value; // value
|
||||
}
|
||||
@ -70,4 +70,13 @@ public class RecognizeQrCodeResp {
|
||||
*/
|
||||
private Float rate;
|
||||
|
||||
|
||||
/***
|
||||
* 识别码类型条码类型包括:9种条形码(UPC_A、UPC_E、EAN_13、EAN_8、CODE_39、CODE_93、CODE_128、ITF、CODABAR),4种二维码(QR_CODE、DATA_MATRIX、AZTEC、PDF_417)
|
||||
*/
|
||||
private String type ;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user