|
@@ -40,6 +40,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
@@ -73,6 +74,14 @@ public class HealthReportController {
|
|
|
private static final String LANGGRAPH_BASE_URL = "http://localhost:9000";
|
|
private static final String LANGGRAPH_BASE_URL = "http://localhost:9000";
|
|
|
private static final String REPORT_PARSE_URL = LANGGRAPH_BASE_URL + "/api/v1/report/parse";
|
|
private static final String REPORT_PARSE_URL = LANGGRAPH_BASE_URL + "/api/v1/report/parse";
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * LangGraph 服务地址(生产环境通过 application.yml 覆盖,避免 Docker 容器跨主机调用失败)
|
|
|
|
|
+ * TODO(部署): 容器化部署时需确保 Java 上传目录(uploads/health-reports)
|
|
|
|
|
+ * 对 LangGraph 容器可见(共享 volume 或主机路径挂载),否则 file_path 不可访问将回退本地解析。
|
|
|
|
|
+ */
|
|
|
|
|
+ @Value("${langgraph.base-url:http://localhost:9000}")
|
|
|
|
|
+ private String langgraphBaseUrl;
|
|
|
|
|
+
|
|
|
@Resource
|
|
@Resource
|
|
|
private HealthReportService healthReportService;
|
|
private HealthReportService healthReportService;
|
|
|
|
|
|
|
@@ -499,7 +508,7 @@ public class HealthReportController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ResponseEntity<Map> lgResponse = restTemplate.postForEntity(
|
|
ResponseEntity<Map> lgResponse = restTemplate.postForEntity(
|
|
|
- REPORT_PARSE_URL, lgRequest, Map.class);
|
|
|
|
|
|
|
+ langgraphBaseUrl + "/api/v1/report/parse", lgRequest, Map.class);
|
|
|
Map<String, Object> lgBody = lgResponse.getBody();
|
|
Map<String, Object> lgBody = lgResponse.getBody();
|
|
|
if (lgBody != null && Integer.valueOf(200).equals(lgBody.get("code"))) {
|
|
if (lgBody != null && Integer.valueOf(200).equals(lgBody.get("code"))) {
|
|
|
Map<String, Object> lgData = (Map<String, Object>) lgBody.get("data");
|
|
Map<String, Object> lgData = (Map<String, Object>) lgBody.get("data");
|