feat: OCR接口
This commit is contained in:
@@ -2,7 +2,9 @@ package com.klp.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import com.klp.service.ITesseractOcrService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -35,6 +37,7 @@ import com.klp.common.core.page.TableDataInfo;
|
||||
public class WmsPurchasePlanController extends BaseController {
|
||||
|
||||
private final IWmsPurchasePlanService iWmsPurchasePlanService;
|
||||
private final ITesseractOcrService iTesseractOcrService;
|
||||
|
||||
/**
|
||||
* 新增采购计划(含明细)
|
||||
@@ -52,6 +55,17 @@ public class WmsPurchasePlanController extends BaseController {
|
||||
return R.ok(planVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 识别图片中的文字
|
||||
* @param request 图片地址
|
||||
* @return 识别出的文字
|
||||
*/
|
||||
@PostMapping("/recognizeText")
|
||||
public R<String> recognize(@RequestBody Map<String, String> request) {
|
||||
String imgUrl = request.get("imgUrl");
|
||||
return R.ok(iTesseractOcrService.recognizeText(imgUrl));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询采购计划主列表
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user