|
|
@@ -315,6 +315,29 @@ public class AliController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 支付宝OCR识别
|
|
|
+ *
|
|
|
+ * @param imageId 图片id
|
|
|
+ * @param ocrType OCR识别类型
|
|
|
+ * @return OCR识别结果
|
|
|
+ * @throws Exception 识别异常
|
|
|
+ */
|
|
|
+ @ApiOperation("支付宝OCR识别方式一")
|
|
|
+ @ApiOperationSupport(order = 14)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "imageId", value = "图片id", dataType = "String", paramType = "query", required = true),
|
|
|
+ @ApiImplicitParam(name = "ocrType", value = "OCR识别类型", dataType = "String", paramType = "query", required = true)
|
|
|
+ })
|
|
|
+ @GetMapping("/ocrRequest")
|
|
|
+ public R<JSONObject> ocrRequest(@RequestParam(value = "imageId") String imageId, @RequestParam(value = "ocrType") String ocrType) {
|
|
|
+ try {
|
|
|
+ return aliApi.ocrRequest(imageId, ocrType);
|
|
|
+ } catch (Exception e) {
|
|
|
+ return R.fail("OCR识别异常:"+e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 二手委托人识别(底层调用IDcard识别)
|
|
|
*/
|
|
|
@ApiOperation("二手委托人识别(底层调用IDcard识别)")
|
|
|
@@ -334,4 +357,25 @@ public class AliController {
|
|
|
return R.fail(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 支付宝OCR识别
|
|
|
+ *
|
|
|
+ * @return OCR识别结果
|
|
|
+ * @throws Exception 识别异常
|
|
|
+ */
|
|
|
+ @ApiOperation("支付宝OCR识别方式二")
|
|
|
+ @ApiOperationSupport(order = 15)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "ocrType", value = "OCR识别类型", dataType = "String", paramType = "query", required = true)
|
|
|
+ })
|
|
|
+ @PostMapping("/ocrRequestByBase64")
|
|
|
+ public R ocrRequestByBase64(MultipartFile imageFile,
|
|
|
+ @RequestParam("ocrType") String ocrType) {
|
|
|
+ try {
|
|
|
+ return aliApi.ocrRequestByBase64(imageFile, ocrType);
|
|
|
+ } catch (Exception e) {
|
|
|
+ return R.fail("OCR识别异常:"+e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|