From 3d08e86049e76ace30b4388af36ddc4e86009d52 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 23 Jun 2025 13:44:56 +0800 Subject: [PATCH] =?UTF-8?q?BUGFIX:=E5=9B=BE=E7=89=87=E5=88=86=E5=89=B2?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=80=BC=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/controller/ElementController.java | 4 ++-- .../ai/da/service/impl/CollectionElementServiceImpl.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ai/da/controller/ElementController.java b/src/main/java/com/ai/da/controller/ElementController.java index 8912a006..32e1c23a 100644 --- a/src/main/java/com/ai/da/controller/ElementController.java +++ b/src/main/java/com/ai/da/controller/ElementController.java @@ -113,9 +113,9 @@ public class ElementController { @PostMapping("/imageSegmentation") public Response> selectedImageSeg( @RequestPart(value = "file", required = false) MultipartFile[] file, - @RequestParam(value = "type", required = false) @Pattern(regexp = "sketch|product", message = "类型必须是sketch或product") String type, + @RequestParam(value = "type", required = false) @Pattern(regexp = "sketch|product", message = "Please choose the image type") String type, @RequestParam(value = "id", required = false) Long id, - @RequestParam(value = "sourceType", required = false) @Pattern(regexp = "library|upload", message = "id是从library中获取的还是上传的") String sourceType) { + @RequestParam(value = "sourceType", required = false) @Pattern(regexp = "Library|Upload", message = "Select an image from the library or upload one.") String sourceType) { // 过滤空文件 List nonEmptyFiles = Arrays.stream(file) .filter(item -> !item.isEmpty()) diff --git a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java index b9de700b..ef7c2b40 100644 --- a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java @@ -1018,7 +1018,7 @@ public class CollectionElementServiceImpl extends ServiceImpl restoredList = Arrays.asList(library.getSegmentedData().split(",")); resp.add(createCollectionElementVO(accountId, id, library.getLevel1Type(), library.getUrl(), restoredList)); } - } else if (Objects.nonNull(id) && sourceType.equals("upload")) { + } else if (Objects.nonNull(id) && sourceType.equals("Upload")) { collectionElement = collectionElementMapper.selectById(id); // 判断id对应的数据是否存在 if (Objects.isNull(collectionElement)) { @@ -1064,7 +1064,7 @@ public class CollectionElementServiceImpl extends ServiceImpl