From 766ef373209c2ff60d8b8b4e15d5caed2ad0c6d8 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Mon, 25 Sep 2023 10:14:01 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E6=96=87=E4=BB=B6=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E8=A1=A8=E6=A0=BC=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filemanagement/FileBatchProcessDTO.java | 20 ++----------------- .../service/FileManagementService.java | 4 ++-- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/request/filemanagement/FileBatchProcessDTO.java b/backend/services/project-management/src/main/java/io/metersphere/project/request/filemanagement/FileBatchProcessDTO.java index 45d919ff78..e14984813d 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/request/filemanagement/FileBatchProcessDTO.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/request/filemanagement/FileBatchProcessDTO.java @@ -1,38 +1,22 @@ package io.metersphere.project.request.filemanagement; +import io.metersphere.sdk.dto.TableBatchProcessDTO; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.Valid; import jakarta.validation.constraints.NotBlank; import lombok.Data; -import java.util.ArrayList; import java.util.List; @Data -public class FileBatchProcessDTO { - @Schema(description = "不处理的ID") - List excludeIds; +public class FileBatchProcessDTO extends TableBatchProcessDTO { @Schema(description = "项目ID") @NotBlank(message = "{id must not be blank}") private String projectId; - @Schema(description = "选择的ID", requiredMode = Schema.RequiredMode.REQUIRED) - @Valid - private List< - @NotBlank(message = "{id must not be blank}") - String - > selectIds = new ArrayList<>(); - - @Schema(description = "是否选择所有数据") - private boolean selectAll; - @Schema(description = "文件类型") private List fileTypes; - @Schema(description = "关键字") - private String keyword; - @Schema(description = "模块ID") private List moduleIds; } diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/service/FileManagementService.java b/backend/services/project-management/src/main/java/io/metersphere/project/service/FileManagementService.java index b6efd55368..72502345ec 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/service/FileManagementService.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/service/FileManagementService.java @@ -77,7 +77,7 @@ public class FileManagementService { List processIds = request.getSelectIds(); List refFileList = new ArrayList<>(); if (request.isSelectAll()) { - refFileList = extFileMetadataMapper.selectByKeywordAndFileType(request.getProjectId(), request.getKeyword(), request.getModuleIds(), request.getFileTypes(), true); + refFileList = extFileMetadataMapper.selectByKeywordAndFileType(request.getProjectId(), request.getCondition().getKeyword(), request.getModuleIds(), request.getFileTypes(), true); if (CollectionUtils.isNotEmpty(request.getExcludeIds())) { refFileList = refFileList.stream().filter(fileMetadata -> !request.getExcludeIds().contains(fileMetadata.getId())).collect(Collectors.toList()); } @@ -98,7 +98,7 @@ public class FileManagementService { List processIds = request.getSelectIds(); List refFileList = new ArrayList<>(); if (request.isSelectAll()) { - refFileList = extFileMetadataMapper.selectByKeywordAndFileType(request.getProjectId(), request.getKeyword(), request.getModuleIds(), request.getFileTypes(), false); + refFileList = extFileMetadataMapper.selectByKeywordAndFileType(request.getProjectId(), request.getCondition().getKeyword(), request.getModuleIds(), request.getFileTypes(), false); if (CollectionUtils.isNotEmpty(request.getExcludeIds())) { refFileList = refFileList.stream().filter(fileMetadata -> !request.getExcludeIds().contains(fileMetadata.getId())).collect(Collectors.toList()); }