|
@@ -129,8 +129,6 @@ public class FileController {
|
|
Request request = new Request.Builder()
|
|
Request request = new Request.Builder()
|
|
.url("http://127.0.0.1:5000/recognize_plate")
|
|
.url("http://127.0.0.1:5000/recognize_plate")
|
|
.method("POST", body)
|
|
.method("POST", body)
|
|
- .addHeader("Authorization", "Bearer 964ae94dba204fa0bd3bcc5c27604d7e")
|
|
|
|
- .addHeader("User-Agent", "Apifox/1.0.0 (https://apifox.com)")
|
|
|
|
.addHeader("Accept", "*/*")
|
|
.addHeader("Accept", "*/*")
|
|
.addHeader("Host", "127.0.0.1:5000")
|
|
.addHeader("Host", "127.0.0.1:5000")
|
|
.addHeader("Connection", "keep-alive")
|
|
.addHeader("Connection", "keep-alive")
|
|
@@ -142,7 +140,11 @@ public class FileController {
|
|
// 直接将响应体的字符串内容解析为Map(简单示例,如果有对应Java POJO类,可以解析为具体的POJO对象)
|
|
// 直接将响应体的字符串内容解析为Map(简单示例,如果有对应Java POJO类,可以解析为具体的POJO对象)
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|
|
Map<String, Object> resultMap = objectMapper.readValue(response.body().string(), Map.class);
|
|
Map<String, Object> resultMap = objectMapper.readValue(response.body().string(), Map.class);
|
|
|
|
+ resultMap.forEach((k, v) -> {
|
|
|
|
+ log.info("=====k:{},v:{}",k,v);
|
|
|
|
+ });
|
|
Object data = resultMap.get("data");
|
|
Object data = resultMap.get("data");
|
|
|
|
+ log.info("=====data:{}",data);
|
|
if (data.equals("success")) {
|
|
if (data.equals("success")) {
|
|
System.out.println("解析后的plate_number值: " + resultMap.get("plate_number"));
|
|
System.out.println("解析后的plate_number值: " + resultMap.get("plate_number"));
|
|
return success(resultMap.get("plate_number").toString());
|
|
return success(resultMap.get("plate_number").toString());
|