|
@@ -87,7 +87,7 @@ public class AppAiController {
|
|
|
List<Map<String, Object>> images = new ArrayList<>();
|
|
|
Map<String, Object> variableValue = new HashMap<>();
|
|
|
variableValue.put("transfer_method", "remote_url");
|
|
|
- variableValue.put("url", createReqVO.getImage());
|
|
|
+ variableValue.put("url", minioUrl(createReqVO.getImage()));
|
|
|
variableValue.put("type", "image");
|
|
|
images.add(variableValue);
|
|
|
inputs.put("images", images);
|
|
@@ -96,7 +96,7 @@ public class AppAiController {
|
|
|
List<Map<String, Object>> docs = new ArrayList<>();
|
|
|
Map<String, Object> variableValue = new HashMap<>();
|
|
|
variableValue.put("transfer_method", "remote_url");
|
|
|
- variableValue.put("url", createReqVO.getDoc());
|
|
|
+ variableValue.put("url", minioUrl(createReqVO.getDoc()));
|
|
|
variableValue.put("type", "document");
|
|
|
docs.add(variableValue);
|
|
|
inputs.put("docs", docs);
|
|
@@ -105,6 +105,12 @@ public class AppAiController {
|
|
|
return success(workflowRunService.getDifyResul(inputs, createReqVO.getType()));
|
|
|
}
|
|
|
|
|
|
+ private String minioUrl(String url) {
|
|
|
+ if (StrUtil.isNotBlank(url) && StrUtil.contains(url, "https://zjkdywd.com:9014")) {
|
|
|
+ return url.replaceAll("https://zjkdywd.com:9014", "http://42.194.163.46:9007");
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
@PostMapping("/difyOrcs")
|
|
|
@Operation(summary = "批量图片文档识别并返回前端")
|
|
|
public CommonResult<String> difyOrcs(@RequestBody WorkflowDifyFilesReqVO createReqVO) {
|
|
@@ -114,7 +120,7 @@ public class AppAiController {
|
|
|
for (String image : createReqVO.getImages()) {
|
|
|
Map<String, Object> variableValue = new HashMap<>();
|
|
|
variableValue.put("transfer_method", "remote_url");
|
|
|
- variableValue.put("url", image);
|
|
|
+ variableValue.put("url", minioUrl(image));
|
|
|
variableValue.put("type", "image");
|
|
|
images.add(variableValue);
|
|
|
}
|
|
@@ -125,7 +131,7 @@ public class AppAiController {
|
|
|
for (String image : createReqVO.getDocs()) {
|
|
|
Map<String, Object> variableValue = new HashMap<>();
|
|
|
variableValue.put("transfer_method", "remote_url");
|
|
|
- variableValue.put("url", image);
|
|
|
+ variableValue.put("url", minioUrl(image));
|
|
|
variableValue.put("type", "document");
|
|
|
docs.add(variableValue);
|
|
|
}
|
|
@@ -144,7 +150,7 @@ public class AppAiController {
|
|
|
String apiKey = DictFrameworkUtils.parseDictDataValue("ai_key", "pdf识别");
|
|
|
inputs.put("type", createReqVO.getType());
|
|
|
|
|
|
- inputs.put("pdfUrl", createReqVO.getDoc());
|
|
|
+ inputs.put("pdfUrl", minioUrl(createReqVO.getDoc()));
|
|
|
return success(workflowRunService.getDifyResul(inputs, createReqVO.getType(), apiKey));
|
|
|
}
|
|
|
|
|
@@ -242,7 +248,7 @@ public class AppAiController {
|
|
|
@Operation(summary = "上传文件")
|
|
|
public CommonResult<FileResp> uploadNewFile(@RequestBody WorkflowRunFileReqVO files) {
|
|
|
|
|
|
- return success(workflowRunService.uploadFile(files.getUrl()));
|
|
|
+ return success(workflowRunService.uploadFile(minioUrl(files.getUrl())));
|
|
|
}
|
|
|
|
|
|
}
|