请求参数增加requestBody注解

This commit is contained in:
wulin 2025-08-19 22:04:31 +08:00
parent fd960804e8
commit cdbf47507a
2 changed files with 4 additions and 2 deletions

View File

@ -13,6 +13,7 @@ import com.heyu.api.data.utils.R;
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;
@ -39,7 +40,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 {
//读取文件内容到Stream流中按行读取

View File

@ -15,6 +15,7 @@ import com.heyu.api.data.utils.R;
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;
@ -35,7 +36,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"));