From 59c2aae04725c551ed73facc783d10ca38a9a222 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Tue, 16 Jul 2024 10:16:29 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E4=BB=85=E6=94=AF=E6=8C=81=E5=AF=BC?= =?UTF-8?q?=E5=87=BAHTTP=E5=8D=8F=E8=AE=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/service/definition/ApiDefinitionExportService.java | 2 ++ frontend/src/views/api-test/management/locale/en-US.ts | 2 +- frontend/src/views/api-test/management/locale/zh-CN.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionExportService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionExportService.java index 1d38c22928..8036315bc9 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionExportService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionExportService.java @@ -10,6 +10,7 @@ import io.metersphere.api.mapper.ExtApiDefinitionMapper; import io.metersphere.api.parser.api.Swagger3ExportParser; import io.metersphere.project.domain.Project; import io.metersphere.project.mapper.ProjectMapper; +import io.metersphere.sdk.constants.ModuleConstants; import io.metersphere.sdk.exception.MSException; import jakarta.annotation.Resource; import org.apache.commons.collections.CollectionUtils; @@ -36,6 +37,7 @@ public class ApiDefinitionExportService { private ProjectMapper projectMapper; public ApiExportResponse export(ApiDefinitionBatchRequest request, String type, String userId) { + request.setProtocols(List.of(ModuleConstants.NODE_PROTOCOL_HTTP)); List ids = apiDefinitionService.getBatchApiIds(request, request.getProjectId(), request.getProtocols(), false, userId); if (CollectionUtils.isEmpty(ids)) { return new ApiExportResponse(); diff --git a/frontend/src/views/api-test/management/locale/en-US.ts b/frontend/src/views/api-test/management/locale/en-US.ts index 245446b111..abb174f92d 100644 --- a/frontend/src/views/api-test/management/locale/en-US.ts +++ b/frontend/src/views/api-test/management/locale/en-US.ts @@ -80,7 +80,7 @@ export default { 'apiTestManagement.moreSetting': 'More Settings', 'apiTestManagement.importType': 'Import Type', 'apiTestManagement.urlImport': 'URL Import', - 'apiTestManagement.swagger.export': 'Export Swagger3.0', + 'apiTestManagement.swagger.export': 'Export Swagger3.0(Only supports HTTP protocol)', 'apiTestManagement.syncImportCase': 'Sync Import API Cases', 'apiTestManagement.syncUpdateDirectory': 'Sync Update API Directory', 'apiTestManagement.importSwaggerFileTip1': 'Supports Swagger 3.0 version JSON files,', diff --git a/frontend/src/views/api-test/management/locale/zh-CN.ts b/frontend/src/views/api-test/management/locale/zh-CN.ts index a79262c664..53afca8468 100644 --- a/frontend/src/views/api-test/management/locale/zh-CN.ts +++ b/frontend/src/views/api-test/management/locale/zh-CN.ts @@ -75,7 +75,7 @@ export default { 'apiTestManagement.moreSetting': '更多设置', 'apiTestManagement.importType': '导入方式', 'apiTestManagement.urlImport': 'URL 导入', - 'apiTestManagement.swagger.export': '导出 Swagger3.0 格式', + 'apiTestManagement.swagger.export': '导出 Swagger3.0 格式(仅支持HTTP协议)', 'apiTestManagement.syncImportCase': '同步导入接口用例', 'apiTestManagement.syncUpdateDirectory': '同步更新接口所在目录', 'apiTestManagement.importSwaggerFileTip1': '支持 Swagger 3.0 版本的 json 文件,',