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()); }