From d6c869727abda236215f4ffc10e08bf018e385e5 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 14 Apr 2025 15:18:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E8=A6=81=E6=B1=82=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/controller/ElementController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ai/da/controller/ElementController.java b/src/main/java/com/ai/da/controller/ElementController.java index ee0b65f6..96010a03 100644 --- a/src/main/java/com/ai/da/controller/ElementController.java +++ b/src/main/java/com/ai/da/controller/ElementController.java @@ -112,12 +112,12 @@ public class ElementController { @ApiOperation(value = "图片分割") @PostMapping("/imageSegmentation") public Response> selectedImageSeg( - @RequestPart(value = "files", required = false) MultipartFile[] files, + @RequestPart(value = "file", required = false) MultipartFile[] file, @RequestParam(value = "type", required = false) @Pattern(regexp = "sketch|product", message = "类型必须是sketch或product") String type, @RequestParam(value = "id", required = false) Long id) { // 过滤空文件 - List nonEmptyFiles = Arrays.stream(files) - .filter(file -> !file.isEmpty()) + List nonEmptyFiles = Arrays.stream(file) + .filter(item -> !item.isEmpty()) .collect(Collectors.toList()); // 参数校验 if ((nonEmptyFiles.isEmpty()) && id == null) {