请求参数增加requestBody注解
This commit is contained in:
parent
fd960804e8
commit
cdbf47507a
@ -13,6 +13,7 @@ import com.heyu.api.data.utils.R;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
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
|
// http://localhost:8888/general/text/orc/recognize?imageBase64=3232
|
||||||
@EbAuthentication(tencent = ApiConstants.TENCENT_AUTH)
|
@EbAuthentication(tencent = ApiConstants.TENCENT_AUTH)
|
||||||
@RequestMapping("/recognize")
|
@RequestMapping("/recognize")
|
||||||
public R recognize(GeneralBasicOcrRequest generalBasicOcrRequest) throws Exception {
|
public R recognize(@RequestBody GeneralBasicOcrRequest generalBasicOcrRequest) throws Exception {
|
||||||
|
|
||||||
|
|
||||||
//读取文件内容到Stream流中,按行读取
|
//读取文件内容到Stream流中,按行读取
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import com.heyu.api.data.utils.R;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@ -35,7 +36,7 @@ public class HighPrecisionOcrController {
|
|||||||
// https://heyuoss.oss-cn-shanghai.aliyuncs.com/prd/testxxx.jpg
|
// https://heyuoss.oss-cn-shanghai.aliyuncs.com/prd/testxxx.jpg
|
||||||
@EbAuthentication(tencent = ApiConstants.TENCENT_AUTH)
|
@EbAuthentication(tencent = ApiConstants.TENCENT_AUTH)
|
||||||
@RequestMapping("/recognize")
|
@RequestMapping("/recognize")
|
||||||
public R recognize(HighPrecisionOcrRequest generalBasicOcrRequest) throws Exception {
|
public R recognize(@RequestBody HighPrecisionOcrRequest generalBasicOcrRequest) throws Exception {
|
||||||
|
|
||||||
// 读取文件内容到Stream流中,按行读取
|
// 读取文件内容到Stream流中,按行读取
|
||||||
//Stream<String> lines = Files.lines(Paths.get("/Users/quyixiao/gitb/eb-service-api/api-web/api-interface/src/main/resources/pdfbase64.txt"));
|
//Stream<String> lines = Files.lines(Paths.get("/Users/quyixiao/gitb/eb-service-api/api-web/api-interface/src/main/resources/pdfbase64.txt"));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user