This commit is contained in:
quyixiao 2025-08-19 22:49:43 +08:00
commit 7c7d5252c9
2 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,7 @@ import com.heyu.api.data.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -40,7 +41,7 @@ public class GeneralBasicOcrController extends BaseController {
// http://localhost:8888/general/text/orc/recognize?imageBase64=3232
@EbAuthentication(tencent = ApiConstants.TENCENT_AUTH)
@RequestMapping("/recognize")
public R recognize(GeneralBasicOcrRequest generalBasicOcrRequest) throws Exception {
public R recognize(@RequestBody GeneralBasicOcrRequest generalBasicOcrRequest) throws Exception {
//String base64 = Base64Utils.encodeImageToBase64("/Users/quyixiao/Desktop/ocr/testxxx.jpg");

View File

@ -16,6 +16,7 @@ import com.heyu.api.data.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -36,7 +37,7 @@ public class HighPrecisionOcrController {
// https://heyuoss.oss-cn-shanghai.aliyuncs.com/prd/testxxx.jpg
@EbAuthentication(tencent = ApiConstants.TENCENT_AUTH)
@RequestMapping("/recognize")
public R recognize(HighPrecisionOcrRequest generalBasicOcrRequest) throws Exception {
public R recognize(@RequestBody HighPrecisionOcrRequest generalBasicOcrRequest) throws Exception {
// 读取文件内容到Stream流中按行读取
//Stream<String> lines = Files.lines(Paths.get("/Users/quyixiao/gitb/eb-service-api/api-web/api-interface/src/main/resources/pdfbase64.txt"));