diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiDefinitionController.java b/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiDefinitionController.java index 34b89ac5bc..d0b4f13d4c 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiDefinitionController.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiDefinitionController.java @@ -223,7 +223,7 @@ public class ApiDefinitionController { @Operation(summary = "接口测试-接口管理-导入接口定义") public void testCaseImport(@RequestPart(value = "file", required = false) MultipartFile file, @RequestPart("request") ImportRequest request) { request.setUserId(SessionUtils.getUserId()); - apiDefinitionImportService.apiTestImport(file, request, SessionUtils.getCurrentProjectId()); + apiDefinitionImportService.apiDefinitionImport(file, request, SessionUtils.getCurrentProjectId()); } @PostMapping("/operation-history") diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDefinitionImportDetail.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDefinitionDetail.java similarity index 90% rename from backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDefinitionImportDetail.java rename to backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDefinitionDetail.java index ca9df37a7d..06d106ee31 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDefinitionImportDetail.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDefinitionDetail.java @@ -11,7 +11,7 @@ import java.util.List; @Data @EqualsAndHashCode(callSuper = false) -public class ApiDefinitionImportDetail extends ApiDefinition { +public class ApiDefinitionDetail extends ApiDefinition { @Schema(description = "请求内容") private AbstractMsTestElement request; diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDefinitionExportDetail.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDefinitionExportDetail.java new file mode 100644 index 0000000000..0f1a2fd4d1 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDefinitionExportDetail.java @@ -0,0 +1,22 @@ +package io.metersphere.api.dto.converter; + +import io.metersphere.api.dto.definition.ApiDefinitionMockDTO; +import io.metersphere.api.dto.definition.ApiTestCaseDTO; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.ArrayList; +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = false) +public class ApiDefinitionExportDetail extends ApiDefinitionDetail { + + @Schema(description = "接口用例") + private List apiTestCaseList = new ArrayList<>(); + + @Schema(description = "Mock") + private List apiMockList = new ArrayList<>(); + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDefinitionImport.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDefinitionImport.java deleted file mode 100644 index 15250ed707..0000000000 --- a/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDefinitionImport.java +++ /dev/null @@ -1,18 +0,0 @@ -package io.metersphere.api.dto.converter; - -import io.metersphere.api.dto.definition.ApiTestCaseDTO; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -@Data -public class ApiDefinitionImport { - private String projectName; - private String protocol; - private List data; - - // 新版本带用例导出 - private List cases = new ArrayList<>(); - -} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDefinitionPreImportAnalysisResult.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDefinitionPreImportAnalysisResult.java new file mode 100644 index 0000000000..c8c5f92dd4 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDefinitionPreImportAnalysisResult.java @@ -0,0 +1,43 @@ +package io.metersphere.api.dto.converter; + +import io.metersphere.api.dto.definition.ApiDefinitionMockDTO; +import io.metersphere.api.dto.definition.ApiTestCaseDTO; +import io.metersphere.system.dto.sdk.BaseTreeNode; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 接口导入数据准备结果 + */ +@Data +public class ApiDefinitionPreImportAnalysisResult { + @Schema(description = "需要创建的模块数据") + List insertModuleList = new ArrayList<>(); + + @Schema(description = "需要新增的接口") + List insertApiData = new ArrayList<>(); + + @Schema(description = "需要更新的接口") + List updateApiData = new ArrayList<>(); + @Schema(description = "只需要更所属模块的接口") + List updateModuleApiList = new ArrayList<>(); + + + @Schema(description = "需要新增的接口用例") + List insertApiCaseList = new ArrayList<>(); + @Schema(description = "需要修改的接口用例") + List updateApiCaseList = new ArrayList<>(); + + @Schema(description = "需要新增的Mock") + List insertApiMockList = new ArrayList<>(); + @Schema(description = "需要修改的Mock") + List updateApiMockList = new ArrayList<>(); + + @Schema(description = "日志数据") + Map logData = new HashMap<>(); +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDetailWithData.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDetailWithData.java deleted file mode 100644 index 8608ef632b..0000000000 --- a/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDetailWithData.java +++ /dev/null @@ -1,22 +0,0 @@ -package io.metersphere.api.dto.converter; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Data -public class ApiDetailWithData { - @Schema(description = "相同的数据的key") - List sameList = new ArrayList<>(); - @Schema(description = "不同的数据的key") - List differenceList = new ArrayList<>(); - @Schema(description = "数据库中存在的数据") - Map apiDateMap = new HashMap<>(); - @Schema(description = "导入的数据") - Map importDataMap = new HashMap<>(); - -} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDetailWithDataUpdate.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDetailWithDataUpdate.java deleted file mode 100644 index d4a81c77aa..0000000000 --- a/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiDetailWithDataUpdate.java +++ /dev/null @@ -1,21 +0,0 @@ -package io.metersphere.api.dto.converter; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -@Data -public class ApiDetailWithDataUpdate { - @Schema(description = "需要更新模块的数据") - List updateModuleData = new ArrayList<>(); - @Schema(description = "需要更新接口的数据") - List updateRequestData = new ArrayList<>(); - @Schema(description = "需要新增的接口数据") - List addModuleData = new ArrayList<>(); - @Schema(description = "需要新增的日志数据") - Map logData; - -} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiImportDataAnalysisResult.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiImportDataAnalysisResult.java new file mode 100644 index 0000000000..3b9828044c --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiImportDataAnalysisResult.java @@ -0,0 +1,30 @@ +package io.metersphere.api.dto.converter; + +import io.metersphere.api.dto.definition.ApiDefinitionMockDTO; +import io.metersphere.api.dto.definition.ApiTestCaseDTO; +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * api导入数据分析结果 + */ +@Data +public class ApiImportDataAnalysisResult { + + // 新增接口数据 + List insertApiList = new ArrayList<>(); + // 存在的接口数据. Map<导入的接口 , 已存在的接口> + List existenceApiList = new ArrayList<>(); + // 接口的用例数据 + Map> apiIdAndTestCaseMap = new HashMap<>(); + // 接口的mock数据 + Map> apiIdAndMockMap = new HashMap<>(); + + public void addExistenceApi(ApiDefinitionDetail importApi, ApiDefinitionDetail exportApi) { + this.existenceApiList.add(new ExistenceApiDefinitionDetail(importApi, exportApi)); + } +} \ No newline at end of file diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiImportFileParseResult.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiImportFileParseResult.java new file mode 100644 index 0000000000..e251fddbcd --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ApiImportFileParseResult.java @@ -0,0 +1,23 @@ +package io.metersphere.api.dto.converter; + +import io.metersphere.api.dto.definition.ApiDefinitionMockDTO; +import io.metersphere.api.dto.definition.ApiTestCaseDTO; +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * api导入文件解析结果 + */ +@Data +public class ApiImportFileParseResult { + // 接口定义数据 + private List data = new ArrayList<>(); + // 用例数据 + private Map> caseMap = new HashMap<>(); + // mock数据 + private Map> mockMap = new HashMap<>(); +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ExistenceApiDefinitionDetail.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ExistenceApiDefinitionDetail.java new file mode 100644 index 0000000000..8367f5580f --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/converter/ExistenceApiDefinitionDetail.java @@ -0,0 +1,11 @@ +package io.metersphere.api.dto.converter; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class ExistenceApiDefinitionDetail { + private ApiDefinitionDetail importApiDefinition; + private ApiDefinitionDetail existenceApiDefinition; +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionBatchRequest.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionBatchRequest.java index 7736203141..bd29dcb4f2 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionBatchRequest.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionBatchRequest.java @@ -32,4 +32,10 @@ public class ApiDefinitionBatchRequest extends TableBatchProcessDTO implements S @Schema(description = "模块ID(根据模块树查询时要把当前节点以及子节点都放在这里。)") private List<@NotBlank String> moduleIds; + + @Schema(description = "是否同步导出接口用例") + private boolean exportApiCase; + + @Schema(description = "是否同步导出接口Mock") + private boolean exportApiMock; } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiMockWithBlob.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiMockWithBlob.java new file mode 100644 index 0000000000..a004ffb18a --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiMockWithBlob.java @@ -0,0 +1,30 @@ +package io.metersphere.api.dto.definition; + +import io.metersphere.api.domain.ApiDefinitionMockConfig; +import io.metersphere.validation.groups.Created; +import io.metersphere.validation.groups.Updated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; +import lombok.Data; + +@Data +public class ApiMockWithBlob extends ApiDefinitionMockConfig { + + @Schema(description = "mock名称", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{api_definition_mock.name.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 255, message = "{api_definition_mock.name.length_range}", groups = {Created.class, Updated.class}) + private String name; + + @Schema(description = "自定义标签") + private java.util.List tags; + + @Schema(description = "启用/禁用") + private Boolean enable; + + @Schema(description = "") + private Integer statusCode; + + @Schema(description = "接口定义ID") + private String apiDefinitionId; +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiTestCaseWithBlob.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiTestCaseWithBlob.java new file mode 100644 index 0000000000..a871477c8a --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiTestCaseWithBlob.java @@ -0,0 +1,38 @@ +package io.metersphere.api.dto.definition; + +import io.metersphere.api.domain.ApiTestCaseBlob; +import io.metersphere.validation.groups.Created; +import io.metersphere.validation.groups.Updated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; +import lombok.Data; + +@Data +public class ApiTestCaseWithBlob extends ApiTestCaseBlob { + + @Schema(description = "接口用例名称", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{api_test_case.name.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 255, message = "{api_test_case.name.length_range}", groups = {Created.class, Updated.class}) + private String name; + + @Schema(description = "用例等级", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{api_test_case.priority.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{api_test_case.priority.length_range}", groups = {Created.class, Updated.class}) + private String priority; + + + @Schema(description = "标签") + private java.util.List tags; + + @Schema(description = "用例状态", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{api_test_case.status.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 20, message = "{api_test_case.status.length_range}", groups = {Created.class, Updated.class}) + private String status; + + @Schema(description = "最新执行结果状态") + private String lastReportStatus; + + @Schema(description = "接口定义ID") + private String apiDefinitionId; +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/export/MetersphereApiExportResponse.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/export/MetersphereApiExportResponse.java new file mode 100644 index 0000000000..7bfa58bfe3 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/export/MetersphereApiExportResponse.java @@ -0,0 +1,17 @@ +package io.metersphere.api.dto.export; + +import io.metersphere.api.dto.converter.ApiDefinitionExportDetail; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wx + */ +@Data +public class MetersphereApiExportResponse extends ApiExportResponse { + + private List apiDefinitions = new ArrayList<>(); + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/request/ImportRequest.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/request/ImportRequest.java index d1b91244f9..8ed7b294ce 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/dto/request/ImportRequest.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/request/ImportRequest.java @@ -23,16 +23,9 @@ public class ImportRequest { private String platform; @Schema(description = "导入的类型 暂定 API Schedule") private String type; - @Schema(description = "是否覆盖模块") - private Boolean coverModule = false; - @Schema(description = "是否同步导入用例") - private Boolean syncCase = false; - @Schema(description = "是否覆盖数据") - private Boolean coverData = false; + @Schema(description = "协议") private String protocol = ModuleConstants.NODE_PROTOCOL_HTTP; - @Schema(description = "是否开启Basic Auth认证") - private boolean authSwitch = false; @Schema(description = "Basic Auth认证用户名") private String authUsername; @Schema(description = "Basic Auth认证密码") @@ -41,4 +34,18 @@ public class ImportRequest { private String uniquelyIdentifies = "Method & Path"; @Schema(description = "定时任务的资源id") private String resourceId; + + @Schema(description = "是否覆盖模块") + private boolean coverModule; + @Schema(description = "是否同步导入用例") + private boolean syncCase; + @Schema(description = "是否同步导入Mock") + private boolean syncMock; + @Schema(description = "是否覆盖数据") + private boolean coverData; + @Schema(description = "是否开启Basic Auth认证") + private boolean authSwitch; + + @Schema(description = "操作人") + private String operator; } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.java b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.java index ba741cd59d..016a2f2b36 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.java @@ -6,7 +6,7 @@ import io.metersphere.api.domain.ApiTestCase; import io.metersphere.api.dto.ApiDefinitionExecuteInfo; import io.metersphere.api.dto.ReferenceDTO; import io.metersphere.api.dto.ReferenceRequest; -import io.metersphere.api.dto.converter.ApiDefinitionImportDetail; +import io.metersphere.api.dto.converter.ApiDefinitionDetail; import io.metersphere.api.dto.definition.*; import io.metersphere.api.dto.scenario.ScenarioSystemRequest; import io.metersphere.project.dto.DropNode; @@ -50,7 +50,7 @@ public interface ExtApiDefinitionMapper { void updateLatestVersion(@Param("id") String id, @Param("projectId") String projectId); - List importList(@Param("request") ApiDefinitionPageRequest request); + List importList(@Param("request") ApiDefinitionPageRequest request); List selectIdsByIdsAndDeleted(@Param("ids") List ids, @Param("deleted") boolean deleted); diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml index f073a4c9c9..3701774ff2 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml @@ -135,7 +135,7 @@ and deleted = #{deleted} - select api_definition.id, api_definition.`name`, api_definition.protocol, api_definition.`method`, api_definition.`path`, api_definition.version_id, diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMockMapper.java b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMockMapper.java index a72f8a991b..4d664c5de9 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMockMapper.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMockMapper.java @@ -2,6 +2,7 @@ package io.metersphere.api.mapper; import io.metersphere.api.domain.ApiDefinitionMock; import io.metersphere.api.dto.definition.ApiDefinitionMockDTO; +import io.metersphere.api.dto.definition.ApiMockWithBlob; import io.metersphere.api.dto.definition.ApiTestCaseBatchRequest; import io.metersphere.api.dto.definition.request.ApiDefinitionMockPageRequest; import org.apache.ibatis.annotations.Param; @@ -18,4 +19,6 @@ public interface ExtApiDefinitionMockMapper { List getTagsByIds(@Param("ids") List ids); List getMockInfoByIds(@Param("ids") List ids); + + List selectAllDetailByApiIds(@Param("apiIds") List apiIds); } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMockMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMockMapper.xml index fe92eceb10..ec75c238eb 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMockMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMockMapper.xml @@ -61,6 +61,20 @@ + + + + + + and a.protocol in diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.java b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.java index 66d977791f..ab47548910 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.java @@ -115,4 +115,6 @@ public interface ExtApiTestCaseMapper { List getRefApiScenarioCreator(@Param("ids") List caseIds); void clearApiChange(@Param("ids") List ids); + + List selectAllDetailByApiIds(@Param("apiIds") List apiIds); } \ No newline at end of file diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.xml index 62211e2a86..5f8de80517 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.xml @@ -749,4 +749,17 @@ on ass.scenario_id = api_scenario.id and api_scenario.deleted = 0; + + + + + \ No newline at end of file diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/ApiDefinitionImportParser.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/ApiDefinitionImportParser.java new file mode 100644 index 0000000000..fae0bd0ce1 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/ApiDefinitionImportParser.java @@ -0,0 +1,37 @@ +package io.metersphere.api.parser; + + +import io.metersphere.api.dto.converter.ApiDefinitionDetail; +import io.metersphere.api.dto.converter.ApiImportDataAnalysisResult; +import io.metersphere.api.dto.converter.ApiImportFileParseResult; +import io.metersphere.api.dto.request.ImportRequest; + +import java.io.InputStream; +import java.util.List; + +public interface ApiDefinitionImportParser { + + /** + * 解析导入文件 + * + * @param source 导入文件流 + * @param request 导入的请求参数 + * @return 解析后的数据 + * @throws Exception + */ + T parse(InputStream source, ImportRequest request) throws Exception; + + /** + * 判断当前导入的接口定义中,哪些是数据库中存在(需要更新)的,哪些是不存在(需要插入)的。 + * + * @param importParser 准备导入的数据 + * @param existenceApiDefinitionList 数据库中已存在的数据 + * @return 需要入库的模块、需要入库的接口、需要更新的接口 + */ + ApiImportDataAnalysisResult generateInsertAndUpdateData(ApiImportFileParseResult importParser, List existenceApiDefinitionList); + + /** + * 获取解析协议类型 + */ + String getParseProtocol(); +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/ImportParser.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/ImportParser.java deleted file mode 100644 index bab9a6d4cc..0000000000 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/ImportParser.java +++ /dev/null @@ -1,10 +0,0 @@ -package io.metersphere.api.parser; - - -import io.metersphere.api.dto.request.ImportRequest; - -import java.io.InputStream; - -public interface ImportParser { - T parse(InputStream source, ImportRequest request) throws Exception; -} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/ImportParserFactory.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/ImportParserFactory.java index f10c7ff99f..bd3da12cd3 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/ImportParserFactory.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/ImportParserFactory.java @@ -1,17 +1,23 @@ package io.metersphere.api.parser; import io.metersphere.api.constants.ApiImportPlatform; -import io.metersphere.api.parser.api.PostmanParser; -import io.metersphere.api.parser.api.Swagger3Parser; +import io.metersphere.api.parser.api.HarParserApiDefinition; +import io.metersphere.api.parser.api.MetersphereParserApiDefinition; +import io.metersphere.api.parser.api.PostmanParserApiDefinition; +import io.metersphere.api.parser.api.Swagger3ParserApiDefinition; import org.apache.commons.lang3.StringUtils; public class ImportParserFactory { - public static ImportParser getImportParser(String platform) { - if (StringUtils.equals(ApiImportPlatform.Swagger3.name(), platform)) { - return new Swagger3Parser(); - } else if (StringUtils.equals(ApiImportPlatform.Postman.name(), platform)) { - return new PostmanParser(); + public static ApiDefinitionImportParser getImportParser(String platform) { + if (StringUtils.equalsIgnoreCase(ApiImportPlatform.Swagger3.name(), platform)) { + return new Swagger3ParserApiDefinition(); + } else if (StringUtils.equalsIgnoreCase(ApiImportPlatform.Postman.name(), platform)) { + return new PostmanParserApiDefinition(); + } else if (StringUtils.equalsIgnoreCase(ApiImportPlatform.MeterSphere.name(), platform)) { + return new MetersphereParserApiDefinition(); + } else if (StringUtils.equalsIgnoreCase(ApiImportPlatform.Har.name(), platform)) { + return new HarParserApiDefinition(); } return null; } -} +} \ No newline at end of file diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/HarParserApiDefinition.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/HarParserApiDefinition.java new file mode 100644 index 0000000000..ea9a0a0534 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/HarParserApiDefinition.java @@ -0,0 +1,532 @@ +package io.metersphere.api.parser.api; + + +import io.metersphere.api.domain.ApiDefinitionBlob; +import io.metersphere.api.dto.converter.ApiDefinitionDetail; +import io.metersphere.api.dto.converter.ApiImportDataAnalysisResult; +import io.metersphere.api.dto.converter.ApiImportFileParseResult; +import io.metersphere.api.dto.converter.ExistenceApiDefinitionDetail; +import io.metersphere.api.dto.definition.HttpResponse; +import io.metersphere.api.dto.definition.ResponseBody; +import io.metersphere.api.dto.request.ImportRequest; +import io.metersphere.api.dto.request.http.MsHTTPElement; +import io.metersphere.api.dto.request.http.MsHeader; +import io.metersphere.api.dto.request.http.QueryParam; +import io.metersphere.api.dto.request.http.RestParam; +import io.metersphere.api.dto.request.http.body.*; +import io.metersphere.api.mapper.ApiDefinitionBlobMapper; +import io.metersphere.api.parser.api.har.HarUtils; +import io.metersphere.api.parser.api.har.model.*; +import io.metersphere.api.utils.ApiDataUtils; +import io.metersphere.api.utils.JSONUtil; +import io.metersphere.plugin.api.spi.AbstractMsTestElement; +import io.metersphere.sdk.exception.MSException; +import io.metersphere.sdk.util.BeanUtils; +import io.metersphere.sdk.util.CommonBeanFactory; +import io.metersphere.sdk.util.LogUtils; +import io.metersphere.system.uid.IDGenerator; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.json.JSONObject; + +import java.io.InputStream; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + +public class HarParserApiDefinition extends HttpApiDefinitionImportAbstractParser { + + @Override + public ApiImportFileParseResult parse(InputStream source, ImportRequest request) throws Exception { + Har har = null; + try { + har = HarUtils.read(source); + } catch (Exception e) { + LogUtils.error(e.getMessage(), e); + throw new MSException(e.getMessage()); + } + if (ObjectUtils.isEmpty(har) || har.log == null) { + throw new MSException("解析失败,请确认选择的是 Har 格式!"); + } + ApiImportFileParseResult definitionImport = new ApiImportFileParseResult(); + definitionImport.setData(parseRequests(har, request)); + return definitionImport; + } + + @Override + public ApiImportDataAnalysisResult generateInsertAndUpdateData(ApiImportFileParseResult importParser, List existenceApiDefinitionList) { + ApiImportDataAnalysisResult insertAndUpdateData = super.generateInsertAndUpdateData(importParser, existenceApiDefinitionList); + ApiDefinitionBlobMapper apiDefinitionBlobMapper = CommonBeanFactory.getBean(ApiDefinitionBlobMapper.class); + + for (ExistenceApiDefinitionDetail definitionDetail : insertAndUpdateData.getExistenceApiList()) { + ApiDefinitionDetail importApi = definitionDetail.getImportApiDefinition(); + ApiDefinitionDetail savedApi = definitionDetail.getExistenceApiDefinition(); + + ApiDefinitionBlob blob = apiDefinitionBlobMapper.selectByPrimaryKey(savedApi.getId()); + if (blob != null) { + if (blob.getRequest() != null) { + AbstractMsTestElement msTestElement = ApiDataUtils.parseObject(new String(blob.getRequest()), AbstractMsTestElement.class); + savedApi.setRequest(msTestElement); + } + if (blob.getResponse() != null) { + List httpResponses = ApiDataUtils.parseArray(new String(blob.getResponse()), HttpResponse.class); + savedApi.setResponse(httpResponses); + } + } + this.mergeExistenceApiMap(importApi, savedApi); + } + return insertAndUpdateData; + } + + private void mergeExistenceApiMap(ApiDefinitionDetail importApi, ApiDefinitionDetail savedApi) { + MsHTTPElement importHttpElement = (MsHTTPElement) importApi.getRequest(); + if (savedApi.getRequest() != null) { + MsHTTPElement existenceHttpElement = (MsHTTPElement) savedApi.getRequest(); + importHttpElement.setOtherConfig(existenceHttpElement.getOtherConfig()); + importHttpElement.setModuleId(existenceHttpElement.getModuleId()); + importHttpElement.setNum(existenceHttpElement.getNum()); + importHttpElement.setMockNum(existenceHttpElement.getMockNum()); + importHttpElement.setBody(this.mergeBody(importHttpElement.getBody(), existenceHttpElement.getBody())); + importHttpElement.setHeaders(this.mergeHeaders(importHttpElement.getHeaders(), existenceHttpElement.getHeaders())); + importHttpElement.setQuery(this.mergeQuery(importHttpElement.getQuery(), existenceHttpElement.getQuery())); + importHttpElement.setRest(this.mergeRest(importHttpElement.getRest(), existenceHttpElement.getRest())); + } + importApi.setRequest(importHttpElement); + + if (CollectionUtils.isEmpty(importApi.getResponse())) { + importApi.setResponse(savedApi.getResponse()); + } else { + + if (CollectionUtils.isEmpty(savedApi.getResponse())) { + importApi.getResponse().getFirst().setDefaultFlag(true); + } else { + List existenceResponseList = savedApi.getResponse(); + for (HttpResponse importRsp : savedApi.getResponse()) { + boolean isExistence = false; + for (HttpResponse existenceRsp : existenceResponseList) { + if (StringUtils.equals(importRsp.getName(), existenceRsp.getName())) { + isExistence = true; + existenceRsp.setBody(importRsp.getBody()); + existenceRsp.setHeaders(importRsp.getHeaders()); + existenceRsp.setStatusCode(importRsp.getStatusCode()); + } + } + if (!isExistence) { + importRsp.setId(IDGenerator.nextStr()); + existenceResponseList.add(importRsp); + } + } + } + } + + } + + private List mergeRest(List importRestList, List existenceRestList) { + if (CollectionUtils.isNotEmpty(importRestList) && CollectionUtils.isNotEmpty(existenceRestList)) { + for (RestParam importRest : importRestList) { + for (RestParam existenceRest : existenceRestList) { + if (StringUtils.equals(importRest.getKey(), existenceRest.getKey())) { + importRest.setDescription(existenceRest.getDescription()); + importRest.setMaxLength(existenceRest.getMaxLength()); + importRest.setMinLength(existenceRest.getMinLength()); + importRest.setEncode(existenceRest.getEncode()); + } + } + } + } + return importRestList; + } + + private List mergeQuery(List importQueryList, List existenceQueryList) { + if (CollectionUtils.isNotEmpty(importQueryList) && CollectionUtils.isNotEmpty(existenceQueryList)) { + for (QueryParam importQuery : importQueryList) { + for (QueryParam existenceQuery : existenceQueryList) { + if (StringUtils.equals(importQuery.getKey(), existenceQuery.getKey())) { + importQuery.setDescription(existenceQuery.getDescription()); + importQuery.setMaxLength(existenceQuery.getMaxLength()); + importQuery.setMinLength(existenceQuery.getMinLength()); + importQuery.setEncode(existenceQuery.getEncode()); + } + } + } + } + return importQueryList; + } + + private List mergeHeaders(List importHeaders, List existenceHeaders) { + if (CollectionUtils.isNotEmpty(importHeaders) && CollectionUtils.isNotEmpty(existenceHeaders)) { + for (MsHeader importHeader : importHeaders) { + for (MsHeader existenceHeader : existenceHeaders) { + if (StringUtils.equals(importHeader.getKey(), existenceHeader.getKey())) { + importHeader.setDescription(existenceHeader.getDescription()); + } + } + } + } + return importHeaders; + } + + private Body mergeBody(Body importBody, Body existenceBody) { + if (importBody == null) { + return existenceBody; + } else if (existenceBody == null) { + return importBody; + } else { + Body returnBody = new Body(); + BeanUtils.copyBean(returnBody, existenceBody); + + if (importBody.getBinaryBody() != null) { + returnBody.setBinaryBody(importBody.getBinaryBody()); + } + if (importBody.getFormDataBody() != null) { + if (returnBody.getFormDataBody() != null) { + for (FormDataKV importKv : importBody.getFormDataBody().getFormValues()) { + for (FormDataKV existenceKv : returnBody.getFormDataBody().getFormValues()) { + if (StringUtils.equals(existenceKv.getKey(), importKv.getKey())) { + importKv.setDescription(existenceKv.getDescription()); + importKv.setMaxLength(existenceKv.getMaxLength()); + importKv.setMinLength(existenceKv.getMinLength()); + } + } + } + } + returnBody.setFormDataBody(importBody.getFormDataBody()); + } + if (importBody.getJsonBody() != null) { + if (returnBody.getJsonBody() != null) { + returnBody.getJsonBody().setJsonValue(importBody.getJsonBody().getJsonValue()); + } else { + returnBody.setJsonBody(importBody.getJsonBody()); + } + } + if (importBody.getNoneBody() != null) { + returnBody.setNoneBody(importBody.getNoneBody()); + } + if (importBody.getRawBody() != null) { + returnBody.setRawBody(importBody.getRawBody()); + } + if (importBody.getWwwFormBody() != null) { + if (returnBody.getWwwFormBody() != null) { + for (WWWFormKV importKv : importBody.getWwwFormBody().getFormValues()) { + for (WWWFormKV existenceKv : returnBody.getWwwFormBody().getFormValues()) { + if (StringUtils.equals(existenceKv.getKey(), importKv.getKey())) { + importKv.setDescription(existenceKv.getDescription()); + importKv.setMaxLength(existenceKv.getMaxLength()); + importKv.setMinLength(existenceKv.getMinLength()); + } + } + } + } + returnBody.setWwwFormBody(importBody.getWwwFormBody()); + } + if (importBody.getXmlBody() != null) { + returnBody.setXmlBody(importBody.getXmlBody()); + } + return returnBody; + } + } + + private List parseRequests(Har har, ImportRequest importRequest) { + List resultList = new ArrayList<>(); + + List harEntryList = new ArrayList<>(); + if (har.log != null && har.log.entries != null) { + harEntryList = har.log.entries; + } + + for (HarEntry entry : harEntryList) { + HarRequest harRequest = entry.request; + if (harRequest != null) { + String url = harRequest.url; + if (url == null) { + continue; + } + //默认取路径的最后一块 + String[] nameArr = url.split("/"); + String reqName = nameArr[nameArr.length - 1]; + try { + url = URLDecoder.decode(url, StandardCharsets.UTF_8); + if (url.contains("?")) { + url = url.split("\\?")[0]; + } + } catch (Exception e) { + LogUtils.error(e.getMessage(), e); + } + + + ApiDefinitionDetail detail = buildApiDefinition(reqName, url, harRequest.method, null, importRequest); + MsHTTPElement request = super.buildHttpRequest(reqName, url, harRequest.method); + parseParameters(harRequest, request); + parseRequestBody(harRequest, request.getBody()); + detail.setRequest(request); + detail.setResponse(Collections.singletonList(parseResponse(entry.response))); + resultList.add(detail); + } + } + + return resultList; + } + // private void addBodyHeader(MsHTTPElement request) { + // String contentType = StringUtils.EMPTY; + // if (request.getBody() != null && StringUtils.isNotBlank(request.getBody().getType())) { + // switch (request.getBody().getType()) { + // case Body.WWW_FROM: + // contentType = "application/x-www-form-urlencoded"; + // break; + // case Body.JSON_STR: + // contentType = "application/json"; + // break; + // case Body.XML: + // contentType = "application/xml"; + // break; + // case Body.BINARY: + // contentType = "application/octet-stream"; + // break; + // } + // List headers = request.getHeaders(); + // if (headers == null) { + // headers = new ArrayList<>(); + // request.setHeaders(headers); + // } + // if (StringUtils.isNotEmpty(contentType)) { + // addContentType(request.getHeaders(), contentType); + // } + // } + // } + + private void parseParameters(HarRequest harRequest, MsHTTPElement request) { + List queryStringList = harRequest.queryString; + queryStringList.forEach(harQueryParam -> { + parseQueryParameters(harQueryParam, request.getQuery()); + }); + List harHeaderList = harRequest.headers; + harHeaderList.forEach(harHeader -> { + parseHeaderParameters(harHeader, request.getHeaders()); + }); + List harCookieList = harRequest.cookies; + harCookieList.forEach(harCookie -> { + parseCookieParameters(harCookie, request.getHeaders()); + }); + } + + + private void parseCookieParameters(HarCookie harCookie, List headers) { + boolean hasCookie = false; + for (MsHeader header : headers) { + if (StringUtils.equalsIgnoreCase("Cookie", header.getKey())) { + hasCookie = true; + String cookies = Optional.ofNullable(header.getValue()).orElse(StringUtils.EMPTY); + header.setValue(cookies + harCookie.name + "=" + harCookie.value + ";"); + } + } + if (!hasCookie) { + addHeader(headers, "Cookie", harCookie.name + "=" + harCookie.value + ";", harCookie.comment); + } + } + + protected void addHeader(List headers, String key, String value, String description) { + boolean hasContentType = false; + for (MsHeader header : headers) { + if (StringUtils.equalsIgnoreCase(header.getKey(), key)) { + hasContentType = true; + } + } + if (!hasContentType) { + headers.add(new MsHeader() {{ + this.setKey(key); + this.setValue(value); + this.setDescription(description); + }}); + } + } + + private void parseHeaderParameters(HarHeader harHeader, List headers) { + String key = harHeader.name; + String value = harHeader.value; + String description = harHeader.comment; + this.addHeader(headers, key, value, description); + } + + private HttpResponse parseResponse(HarResponse response) { + HttpResponse msResponse = new HttpResponse(); + msResponse.setBody(new ResponseBody()); + msResponse.setName("har"); + msResponse.setHeaders(new ArrayList<>()); + if (response != null) { + msResponse.setStatusCode(String.valueOf(response.status)); + parseResponseHeader(response, msResponse.getHeaders()); + parseResponseBody(response.content, msResponse.getBody()); + } + return msResponse; + } + + private void parseResponseHeader(HarResponse response, List msHeaders) { + List harHeaders = response.headers; + if (harHeaders != null) { + for (HarHeader header : harHeaders) { + msHeaders.add(new MsHeader() {{ + this.setKey(header.name); + this.setValue(header.value); + this.setDescription(header.comment); + }}); + } + } + } + + + private void parseRequestBody(HarRequest requestBody, Body body) { + if (requestBody == null) { + return; + } + HarPostData content = requestBody.postData; + if (StringUtils.equalsIgnoreCase("GET", requestBody.method) || requestBody.postData == null) { + return; + } + String bodyType = content.mimeType; + if (StringUtils.isEmpty(bodyType)) { + body.setRawBody(new RawBody() {{ + this.setValue(content.text); + }}); + } else { + if (bodyType.startsWith(org.springframework.http.MediaType.APPLICATION_FORM_URLENCODED_VALUE)) { + bodyType = Body.BodyType.WWW_FORM.name(); + body.setBodyType(Body.BodyType.WWW_FORM.name()); + List postParams = content.params; + WWWFormBody kv = new WWWFormBody(); + for (HarPostParam postParam : postParams) { + kv.getFormValues().add(new WWWFormKV() {{ + this.setKey(postParam.name); + this.setValue(postParam.value); + }}); + } + body.setWwwFormBody(kv); + } else if (bodyType.startsWith(org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE)) { + if (bodyType.contains("boundary=") && StringUtils.contains(content.text, this.getBoundaryFromContentType(bodyType))) { + String[] textArr = StringUtils.split(content.text, "\r\n"); + String paramData = this.parseMultipartByTextArr(textArr); + JSONObject obj = null; + try { + obj = JSONUtil.parseObject(paramData); + + FormDataBody kv = new FormDataBody(); + for (String key : obj.keySet()) { + String value = obj.optString(key); + kv.getFormValues().add(new FormDataKV() {{ + this.setKey(key); + this.setValue(value); + }}); + } + body.setFormDataBody(kv); + } catch (Exception e) { + obj = null; + } + if (obj == null) { + body.setRawBody(new RawBody() {{ + this.setValue(paramData); + }}); + } + } else { + List postParams = content.params; + if (CollectionUtils.isNotEmpty(postParams)) { + FormDataBody kv = new FormDataBody(); + for (HarPostParam postParam : postParams) { + kv.getFormValues().add(new FormDataKV() {{ + this.setKey(postParam.name); + this.setValue(postParam.value); + }}); + } + body.setFormDataBody(kv); + } + } + bodyType = Body.BodyType.FORM_DATA.name(); + } else if (bodyType.startsWith(org.springframework.http.MediaType.APPLICATION_JSON_VALUE)) { + bodyType = Body.BodyType.JSON.name(); + body.setJsonBody(new JsonBody() {{ + this.setJsonValue(content.text); + }}); + } else if (bodyType.startsWith(org.springframework.http.MediaType.APPLICATION_XML_VALUE)) { + bodyType = Body.BodyType.XML.name(); + body.setXmlBody(new XmlBody() {{ + this.setValue(content.text); + }}); + } else if (bodyType.startsWith(org.springframework.http.MediaType.APPLICATION_OCTET_STREAM_VALUE)) { + bodyType = Body.BodyType.BINARY.name(); + List postParams = content.params; + // for (HarPostParam postParam : postParams) { + // KeyValue kv = new KeyValue(postParam.name, postParam.value); + // body.getFormDataBody().add(kv); + // } + } else { + body.setRawBody(new RawBody() {{ + this.setValue(content.text); + }}); + } + } + body.setBodyType(bodyType); + } + + private String getBoundaryFromContentType(String contentType) { + if (StringUtils.contains(contentType, "boundary=")) { + String[] strArr = StringUtils.split(contentType, "boundary="); + return strArr[strArr.length - 1]; + } + return null; + } + + private String parseMultipartByTextArr(String[] textArr) { + String data = null; + if (textArr != null && textArr.length > 2) { + data = textArr[textArr.length - 2]; + } + return data; + } + + + private void parseResponseBody(HarContent content, ResponseBody body) { + if (content == null) { + return; + } + String contentType = content.mimeType; + if (body != null) { + switch (contentType) { + case "application/x-www-form-urlencoded": + body.setBodyType(Body.BodyType.WWW_FORM.name()); + break; + case "multipart/form-data": + body.setBodyType(Body.BodyType.FORM_DATA.name()); + break; + case "application/json": + body.setBodyType(Body.BodyType.JSON.name()); + body.setJsonBody(new JsonBody() {{ + this.setJsonValue(content.text); + }}); + break; + case "application/xml": + body.setBodyType(Body.BodyType.XML.name()); + body.setXmlBody(new XmlBody() {{ + this.setValue(content.text); + }}); + break; + case "application/octet-stream": + body.setBodyType(Body.BodyType.BINARY.name()); + default: + body.setBodyType(Body.BodyType.RAW.name()); + body.setRawBody(new RawBody() {{ + this.setValue(content.text); + }}); + } + } + } + + private void parseQueryParameters(HarQueryParam harQueryParam, List arguments) { + arguments.add(new QueryParam() {{ + this.setKey(harQueryParam.name); + this.setValue(harQueryParam.value); + this.setDescription(harQueryParam.comment); + }}); + } +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/ApiImportAbstractParser.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/HttpApiDefinitionImportAbstractParser.java similarity index 51% rename from backend/services/api-test/src/main/java/io/metersphere/api/parser/api/ApiImportAbstractParser.java rename to backend/services/api-test/src/main/java/io/metersphere/api/parser/api/HttpApiDefinitionImportAbstractParser.java index a9c5d851c2..eb671ead2b 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/ApiImportAbstractParser.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/HttpApiDefinitionImportAbstractParser.java @@ -1,15 +1,21 @@ package io.metersphere.api.parser.api; -import io.metersphere.api.dto.converter.ApiDefinitionImportDetail; +import io.metersphere.api.dto.converter.ApiDefinitionDetail; +import io.metersphere.api.dto.converter.ApiImportDataAnalysisResult; +import io.metersphere.api.dto.converter.ApiImportFileParseResult; +import io.metersphere.api.dto.definition.ApiDefinitionMockDTO; +import io.metersphere.api.dto.definition.ApiTestCaseDTO; import io.metersphere.api.dto.request.ImportRequest; import io.metersphere.api.dto.request.http.MsHTTPConfig; import io.metersphere.api.dto.request.http.MsHTTPElement; import io.metersphere.api.dto.request.http.body.*; -import io.metersphere.api.parser.ImportParser; +import io.metersphere.api.parser.ApiDefinitionImportParser; import io.metersphere.project.dto.environment.auth.NoAuth; +import io.metersphere.project.dto.environment.http.HttpConfig; import io.metersphere.sdk.exception.MSException; import io.metersphere.sdk.util.LogUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import java.io.BufferedReader; @@ -18,10 +24,53 @@ import java.io.InputStreamReader; import java.net.URI; import java.nio.charset.StandardCharsets; import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; -public abstract class ApiImportAbstractParser implements ImportParser { +public abstract class HttpApiDefinitionImportAbstractParser implements ApiDefinitionImportParser { - protected String projectId; + @Override + public String getParseProtocol() { + return HttpConfig.HttpProtocolType.HTTP.name(); + } + + @Override + public ApiImportDataAnalysisResult generateInsertAndUpdateData(ApiImportFileParseResult importParser, List existenceApiDefinitionList) { + // API类型,通过 Method & Path 组合判断,接口是否存在 + Map savedApiDefinitionMap = existenceApiDefinitionList.stream().collect(Collectors.toMap(t -> t.getMethod() + t.getPath(), t -> t, (oldValue, newValue) -> newValue)); + Map importDataMap = importParser.getData().stream().collect(Collectors.toMap(t -> t.getMethod() + t.getPath(), t -> t, (oldValue, newValue) -> newValue)); + + ApiImportDataAnalysisResult insertAndUpdateData = new ApiImportDataAnalysisResult(); + + importDataMap.forEach((key, api) -> { + if (savedApiDefinitionMap.containsKey(key)) { + insertAndUpdateData.addExistenceApi(api, savedApiDefinitionMap.get(key)); + } else { + insertAndUpdateData.getInsertApiList().add(api); + } + List caseList = importParser.getCaseMap().get(api.getId()); + if (CollectionUtils.isNotEmpty(caseList)) { + insertAndUpdateData.getApiIdAndTestCaseMap().put(api.getId(), caseList); + } + List mockDTOList = importParser.getMockMap().get(api.getId()); + if (CollectionUtils.isNotEmpty(mockDTOList)) { + insertAndUpdateData.getApiIdAndMockMap().put(api.getId(), mockDTOList); + } + }); + + return insertAndUpdateData; + } + + public String getUniqueName(String originalName, List existenceNameList) { + String returnName = originalName; + int index = 1; + while (existenceNameList.contains(returnName)) { + returnName = originalName + " - " + index; + index++; + } + return returnName; + } protected String getApiTestStr(InputStream source) { StringBuilder testStr = null; @@ -40,15 +89,13 @@ public abstract class ApiImportAbstractParser implements ImportParser { } - - protected ApiDefinitionImportDetail buildApiDefinition(String name, String path, String method,String modulePath, ImportRequest importRequest) { - ApiDefinitionImportDetail apiDefinition = new ApiDefinitionImportDetail(); + protected ApiDefinitionDetail buildApiDefinition(String name, String path, String method, String modulePath, ImportRequest importRequest) { + ApiDefinitionDetail apiDefinition = new ApiDefinitionDetail(); apiDefinition.setName(name); apiDefinition.setPath(formatPath(path)); apiDefinition.setProtocol(importRequest.getProtocol()); apiDefinition.setMethod(method); - apiDefinition.setProjectId(this.projectId); - apiDefinition.setCreateUser(importRequest.getUserId()); + apiDefinition.setProjectId(importRequest.getProjectId()); apiDefinition.setModulePath(modulePath); apiDefinition.setResponse(new ArrayList<>()); return apiDefinition; diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/MetersphereExportParser.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/MetersphereExportParser.java new file mode 100644 index 0000000000..72a6ff3c4e --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/MetersphereExportParser.java @@ -0,0 +1,81 @@ +package io.metersphere.api.parser.api; + +import io.metersphere.api.dto.converter.ApiDefinitionExportDetail; +import io.metersphere.api.dto.definition.*; +import io.metersphere.api.dto.export.ApiExportResponse; +import io.metersphere.api.dto.export.MetersphereApiExportResponse; +import io.metersphere.api.dto.mockserver.MockMatchRule; +import io.metersphere.api.dto.mockserver.MockResponse; +import io.metersphere.api.dto.request.http.MsHTTPElement; +import io.metersphere.api.utils.ApiDataUtils; +import io.metersphere.plugin.api.spi.AbstractMsTestElement; +import io.metersphere.sdk.constants.ModuleConstants; +import io.metersphere.sdk.util.Translator; +import org.apache.commons.lang3.StringUtils; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class MetersphereExportParser { + + public ApiExportResponse parse(List apiDefinitionList, List apiTestCaseList, List apiMockList, Map moduleMap) { + + Map> apiTestCaseMap = apiTestCaseList.stream().collect(Collectors.groupingBy(ApiTestCaseWithBlob::getApiDefinitionId)); + Map> apiMockMap = apiMockList.stream().collect(Collectors.groupingBy(ApiMockWithBlob::getApiDefinitionId)); + + MetersphereApiExportResponse response = new MetersphereApiExportResponse(); + for (ApiDefinitionWithBlob blob : apiDefinitionList) { + ApiDefinitionExportDetail detail = new ApiDefinitionExportDetail(); + if (blob.getRequest() != null) { + detail.setRequest(ApiDataUtils.parseObject(new String(blob.getRequest()), AbstractMsTestElement.class)); + } + if (blob.getResponse() != null) { + detail.setResponse(ApiDataUtils.parseArray(new String(blob.getResponse()), HttpResponse.class)); + } + detail.setName(blob.getName()); + detail.setProtocol(blob.getProtocol()); + detail.setMethod(blob.getMethod()); + detail.setPath(blob.getPath()); + detail.setStatus(blob.getStatus()); + detail.setTags(blob.getTags()); + detail.setPos(blob.getPos()); + detail.setDescription(blob.getDescription()); + + String moduleName; + if (StringUtils.equals(blob.getModuleId(), ModuleConstants.DEFAULT_NODE_ID)) { + moduleName = Translator.get("api_unplanned_request"); + } else { + moduleName = moduleMap.get(blob.getModuleId()); + } + detail.setModulePath(moduleName); + response.getApiDefinitions().add(detail); + + if (apiTestCaseMap.containsKey(blob.getId())) { + for (ApiTestCaseWithBlob apiTestCaseWithBlob : apiTestCaseMap.get(blob.getId())) { + ApiTestCaseDTO dto = new ApiTestCaseDTO(); + dto.setName(apiTestCaseWithBlob.getName()); + dto.setPriority(apiTestCaseWithBlob.getPriority()); + dto.setStatus(apiTestCaseWithBlob.getStatus()); + dto.setLastReportStatus(apiTestCaseWithBlob.getLastReportStatus()); + dto.setTags(apiTestCaseWithBlob.getTags()); + dto.setRequest(ApiDataUtils.parseObject(new String(apiTestCaseWithBlob.getRequest()), MsHTTPElement.class)); + detail.getApiTestCaseList().add(dto); + } + } + if (apiMockMap.containsKey(blob.getId())) { + for (ApiMockWithBlob apiMockWithBlob : apiMockMap.get(blob.getId())) { + ApiDefinitionMockDTO mockDTO = new ApiDefinitionMockDTO(); + mockDTO.setName(apiMockWithBlob.getName()); + mockDTO.setTags(apiMockWithBlob.getTags()); + mockDTO.setEnable(apiMockWithBlob.getEnable()); + mockDTO.setStatusCode(apiMockWithBlob.getStatusCode()); + mockDTO.setMockMatchRule(ApiDataUtils.parseObject(new String(apiMockWithBlob.getMatching()), MockMatchRule.class)); + mockDTO.setResponse(ApiDataUtils.parseObject(new String(apiMockWithBlob.getResponse()), MockResponse.class)); + detail.getApiMockList().add(mockDTO); + } + } + } + return response; + } +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/MetersphereParserApiDefinition.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/MetersphereParserApiDefinition.java new file mode 100644 index 0000000000..752d03e1b2 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/MetersphereParserApiDefinition.java @@ -0,0 +1,136 @@ +package io.metersphere.api.parser.api; + + +import io.metersphere.api.dto.converter.ApiDefinitionExportDetail; +import io.metersphere.api.dto.converter.ApiImportFileParseResult; +import io.metersphere.api.dto.definition.ApiDefinitionMockDTO; +import io.metersphere.api.dto.definition.ApiTestCaseDTO; +import io.metersphere.api.dto.export.MetersphereApiExportResponse; +import io.metersphere.api.dto.request.ImportRequest; +import io.metersphere.api.utils.ApiDataUtils; +import io.metersphere.sdk.exception.MSException; +import io.metersphere.sdk.util.LogUtils; +import io.metersphere.system.uid.IDGenerator; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MetersphereParserApiDefinition extends HttpApiDefinitionImportAbstractParser { + + @Override + public ApiImportFileParseResult parse(InputStream source, ImportRequest request) throws Exception { + MetersphereApiExportResponse metersphereApiExportResponse = null; + try { + metersphereApiExportResponse = ApiDataUtils.parseObject(source, MetersphereApiExportResponse.class); + } catch (Exception e) { + LogUtils.error(e.getMessage(), e); + throw new MSException(e.getMessage()); + } + if (metersphereApiExportResponse == null) { + throw new MSException("解析失败,请确认选择的是 Metersphere 格式!"); + } + return this.genApiDefinitionImport(metersphereApiExportResponse.getApiDefinitions()); + } + + private ApiImportFileParseResult genApiDefinitionImport(List apiDefinitions) { + List distinctImportList = this.mergeApiCaseWithUniqueIdentification(apiDefinitions); + ApiImportFileParseResult returnDTO = new ApiImportFileParseResult(); + distinctImportList.forEach(definitionImportDetail -> { + String apiID = IDGenerator.nextStr(); + definitionImportDetail.setId(apiID); + List caseList = new ArrayList<>(); + List mockList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(definitionImportDetail.getApiTestCaseList())) { + definitionImportDetail.getApiTestCaseList().forEach(item -> { + item.setApiDefinitionId(apiID); + item.setProtocol(definitionImportDetail.getProtocol()); + caseList.add(item); + }); + } + if (CollectionUtils.isNotEmpty(definitionImportDetail.getApiMockList())) { + definitionImportDetail.getApiMockList().forEach(item -> { + item.setApiDefinitionId(apiID); + mockList.add(item); + }); + } + returnDTO.getData().add(definitionImportDetail); + if (CollectionUtils.isNotEmpty(caseList)) { + returnDTO.getCaseMap().put(apiID, this.apiCaseRename(caseList)); + } + if (CollectionUtils.isNotEmpty(mockList)) { + returnDTO.getMockMap().put(apiID, this.apiMockRename(mockList)); + } + }); + + return returnDTO; + } + + private List apiCaseRename(List caseList) { + List returnList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(caseList)) { + List caseNameList = new ArrayList<>(); + for (ApiTestCaseDTO apiCase : caseList) { + String uniqueName = this.getUniqueName(apiCase.getName(), caseNameList); + apiCase.setName(uniqueName); + caseNameList.add(uniqueName); + returnList.add(apiCase); + } + } + return returnList; + } + + private List apiMockRename(List caseList) { + List returnList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(caseList)) { + List caseNameList = new ArrayList<>(); + for (ApiDefinitionMockDTO apiMock : caseList) { + String uniqueName = this.getUniqueName(apiMock.getName(), caseNameList); + apiMock.setName(uniqueName); + caseNameList.add(uniqueName); + returnList.add(apiMock); + } + } + return returnList; + } + + //合并相同路径下的用例和mock + private List mergeApiCaseWithUniqueIdentification(List apiDefinitions) { + List returnList = new ArrayList<>(); + Map filterApiMap = new HashMap<>(); + Map> uniqueCaseMap = new HashMap<>(); + Map> uniqueMockMap = new HashMap<>(); + apiDefinitions.forEach((api) -> { + String key = api.getMethod() + StringUtils.SPACE + api.getPath(); + if (!filterApiMap.containsKey(key)) { + filterApiMap.put(key, api); + } + if (CollectionUtils.isNotEmpty(api.getApiTestCaseList())) { + if (uniqueCaseMap.containsKey(key)) { + uniqueCaseMap.get(key).addAll(api.getApiTestCaseList()); + } else { + uniqueCaseMap.put(key, api.getApiTestCaseList()); + } + } + if (CollectionUtils.isNotEmpty(api.getApiMockList())) { + if (uniqueMockMap.containsKey(key)) { + uniqueMockMap.get(key).addAll(api.getApiMockList()); + } else { + uniqueMockMap.put(key, api.getApiMockList()); + } + } + + }); + filterApiMap.forEach((key, api) -> { + api.setApiTestCaseList(uniqueCaseMap.get(key)); + api.setApiMockList(uniqueMockMap.get(key)); + returnList.add(api); + }); + return returnList; + } + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanAbstractParserParser.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanAbstractParserParserApiDefinition.java similarity index 81% rename from backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanAbstractParserParser.java rename to backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanAbstractParserParserApiDefinition.java index 655cc911cc..ff461fe92b 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanAbstractParserParser.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanAbstractParserParserApiDefinition.java @@ -7,8 +7,7 @@ import com.fasterxml.jackson.databind.node.BooleanNode; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; import io.metersphere.api.dto.ApiFile; -import io.metersphere.api.dto.converter.ApiDefinitionImportDetail; -import io.metersphere.api.dto.definition.HttpResponse; +import io.metersphere.api.dto.converter.ApiDefinitionDetail; import io.metersphere.api.dto.request.ImportRequest; import io.metersphere.api.dto.request.MsCommonElement; import io.metersphere.api.dto.request.http.MsHTTPElement; @@ -27,17 +26,14 @@ import io.metersphere.plugin.api.spi.AbstractMsTestElement; import io.metersphere.project.dto.environment.auth.BasicAuth; import io.metersphere.project.dto.environment.auth.DigestAuth; import io.metersphere.project.dto.environment.auth.HTTPAuthConfig; -import io.metersphere.system.uid.IDGenerator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; +import java.util.*; -public abstract class PostmanAbstractParserParser extends ApiImportAbstractParser { +public abstract class PostmanAbstractParserParserApiDefinition extends HttpApiDefinitionImportAbstractParser { private static final String POSTMAN_AUTH_TYPE_BASIC = "basic"; @@ -63,18 +59,8 @@ public abstract class PostmanAbstractParserParser extends ApiImportAbstractPa private static final String JSON = "json"; private static final String XML = "xml"; - - protected ApiDefinitionImportDetail parsePostman(PostmanItem requestItem, String modulePath, ImportRequest importRequest) { - PostmanRequest requestDesc = requestItem.getRequest(); - if (requestDesc == null) { - return null; - } - String url = StringUtils.EMPTY; - JsonNode urlNode = requestDesc.getUrl(); - //获取url - url = getUrl(urlNode, url); - ApiDefinitionImportDetail detail = buildApiDefinition(requestItem.getName(), url, requestDesc.getMethod(), modulePath, importRequest); - MsHTTPElement request = buildHttpRequest(requestItem.getName(), url, requestDesc.getMethod()); + private MsHTTPElement parseElement(PostmanRequest requestDesc, String name, String url, JsonNode urlNode) { + MsHTTPElement request = buildHttpRequest(name, url, requestDesc.getMethod()); //设置认证 setAuth(requestDesc, request); //设置基础参数 请求头 @@ -87,6 +73,18 @@ public abstract class PostmanAbstractParserParser extends ApiImportAbstractPa } //设置body参数 setBody(requestDesc, request); + return request; + } + + protected Map> parsePostman(PostmanItem requestItem, String modulePath, ImportRequest importRequest) { + PostmanRequest requestDesc = requestItem.getRequest(); + if (requestDesc == null) { + return null; + } + String url = getUrl(requestDesc.getUrl()); + ApiDefinitionDetail detail = buildApiDefinition(requestItem.getName(), url, requestDesc.getMethod(), modulePath, importRequest); + MsHTTPElement request = parseElement(requestDesc, requestItem.getName(), url, requestDesc.getUrl()); + // 其他设置 PostmanItem.ProtocolProfileBehavior protocolProfileBehavior = requestItem.getProtocolProfileBehavior(); request.getOtherConfig().setFollowRedirects(protocolProfileBehavior != null && @@ -97,42 +95,46 @@ public abstract class PostmanAbstractParserParser extends ApiImportAbstractPa LinkedList children = new LinkedList<>(); children.add(new MsCommonElement()); request.setChildren(children); - detail.setRequest(request); - //设置response - setResponseData(requestItem, detail); - - return detail; + List postmanExamples = this.parsePostmanRequest(requestItem, modulePath, importRequest); + return new HashMap<>() {{ + this.put(detail, postmanExamples); + }}; } - private static void setResponseData(PostmanItem requestItem, ApiDefinitionImportDetail detail) { + private String initApiCaseName(String originalName, List savedResponseName) { + if (savedResponseName.contains(originalName)) { + int i = 1; + while (savedResponseName.contains(originalName + "_" + i)) { + i++; + } + return originalName + "_" + i; + } + return originalName; + } + + private List parsePostmanRequest(PostmanItem requestItem, String modulePath, ImportRequest importRequest) { + List postmanExamples = new ArrayList<>(); List response = requestItem.getResponse(); + List savedResponseName = new ArrayList<>(); if (CollectionUtils.isNotEmpty(response)) { response.forEach(r -> { - HttpResponse httpResponse = new HttpResponse(); - httpResponse.setId(IDGenerator.nextStr()); - httpResponse.setName(r.getName()); - httpResponse.setStatusCode(r.getCode().toString()); - if (CollectionUtils.isNotEmpty(r.getHeader())) { - r.getHeader().forEach(h -> { - MsHeader msHeader = getMsHeader(h); - httpResponse.getHeaders().add(msHeader); - }); - } - httpResponse.getBody().getJsonBody().setJsonValue(r.getBody() != null && r.getBody() instanceof TextNode ? r.getBody().asText() : StringUtils.EMPTY); - httpResponse.getBody().setBodyType(Body.BodyType.RAW.name()); - detail.getResponse().add(httpResponse); + PostmanRequest postmanRequest = r.getOriginalRequest(); + String name = this.initApiCaseName(r.getName(), savedResponseName); + String url = getUrl(postmanRequest.getUrl()); + ApiDefinitionDetail detail = buildApiDefinition(name, url, postmanRequest.getMethod(), modulePath, importRequest); + MsHTTPElement request = parseElement(postmanRequest, name, url, postmanRequest.getUrl()); + //构造 children + LinkedList children = new LinkedList<>(); + children.add(new MsCommonElement()); + request.setChildren(children); + detail.setRequest(request); + postmanExamples.add(detail); + savedResponseName.add(name); }); - detail.getResponse().forEach(httpResponse -> { - if (StringUtils.equals("200", httpResponse.getStatusCode())) { - httpResponse.setDefaultFlag(true); - } - }); - if (detail.getResponse().stream().noneMatch(httpResponse -> StringUtils.equals("200", httpResponse.getStatusCode()))) { - detail.getResponse().getFirst().setDefaultFlag(true); - } } + return postmanExamples; } @NotNull @@ -242,10 +244,14 @@ public abstract class PostmanAbstractParserParser extends ApiImportAbstractPa if (restNode instanceof ArrayNode restArray) { restArray.forEach(r -> { RestParam restParam = new RestParam(); - restParam.setKey(r.get(KEY).asText()); - restParam.setValue(r.get(VALUE).asText()); - restParam.setDescription(r.get(DESCRIPTION) instanceof TextNode ? r.get(DESCRIPTION).asText() : StringUtils.EMPTY); - restParam.setEnable(!(r.get(DISABLED) instanceof BooleanNode) || !r.get(DISABLED).asBoolean()); + restParam.setKey(r.get(KEY) != null ? r.get(KEY).asText() : StringUtils.EMPTY); + restParam.setValue(r.get(VALUE) != null ? r.get(VALUE).asText() : StringUtils.EMPTY); + if (r.get(DESCRIPTION) != null) { + restParam.setDescription(r.get(DESCRIPTION) instanceof TextNode ? r.get(DESCRIPTION).asText() : StringUtils.EMPTY); + } + if (r.get(DESCRIPTION) != null) { + restParam.setEnable(!(r.get(DISABLED) instanceof BooleanNode) || !r.get(DISABLED).asBoolean()); + } request.getRest().add(restParam); }); } @@ -274,7 +280,8 @@ public abstract class PostmanAbstractParserParser extends ApiImportAbstractPa } } - private static String getUrl(JsonNode urlNode, String url) { + private static String getUrl(JsonNode urlNode) { + String url = StringUtils.EMPTY; if (urlNode instanceof ObjectNode urlObject) { JsonNode pathNode = urlObject.get(PATH); if (pathNode instanceof ArrayNode pathArray) { diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanParser.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanParser.java deleted file mode 100644 index c48f293719..0000000000 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanParser.java +++ /dev/null @@ -1,60 +0,0 @@ -package io.metersphere.api.parser.api; - - -import com.fasterxml.jackson.core.JsonProcessingException; -import io.metersphere.api.dto.converter.ApiDefinitionImport; -import io.metersphere.api.dto.converter.ApiDefinitionImportDetail; -import io.metersphere.api.dto.request.ImportRequest; -import io.metersphere.api.parser.api.postman.PostmanCollection; -import io.metersphere.api.parser.api.postman.PostmanItem; -import io.metersphere.sdk.exception.MSException; -import io.metersphere.sdk.util.JSON; -import io.metersphere.sdk.util.LogUtils; -import org.apache.commons.lang3.StringUtils; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -public class PostmanParser extends PostmanAbstractParserParser { - - @Override - public ApiDefinitionImport parse(InputStream source, ImportRequest request) throws JsonProcessingException { - LogUtils.info("PostmanParser parse"); - String testStr = getApiTestStr(source); - this.projectId = request.getProjectId(); - PostmanCollection postmanCollection = JSON.parseObject(testStr, PostmanCollection.class); - if (postmanCollection == null || postmanCollection.getItem() == null || postmanCollection.getItem().isEmpty() || postmanCollection.getInfo() == null){ - throw new MSException("Postman collection is empty"); - } - ApiDefinitionImport apiImport = new ApiDefinitionImport(); - List results = new ArrayList<>(); - - String modulePath = null; - if (StringUtils.isNotBlank(postmanCollection.getInfo().getName())) { - modulePath = "/" + postmanCollection.getInfo().getName(); - } - parseItem(postmanCollection.getItem(), modulePath, results, request); - apiImport.setData(results); - //apiImport.setCases(cases); - LogUtils.info("PostmanParser parse end"); - return apiImport; - } - - protected void parseItem(List items, String modulePath, List results, ImportRequest request) { - for (PostmanItem item : items) { - List childItems = item.getItem(); - if (childItems != null) { - String itemModulePath; - if (StringUtils.isNotBlank(modulePath) && StringUtils.isNotBlank(item.getName())) { - itemModulePath = modulePath + "/" + item.getName(); - } else { - itemModulePath = item.getName(); - } - parseItem(childItems, itemModulePath, results, request); - } else { - results.add(parsePostman(item, modulePath, request)); - } - } - } -} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanParserApiDefinition.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanParserApiDefinition.java new file mode 100644 index 0000000000..ee5ea263e6 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanParserApiDefinition.java @@ -0,0 +1,131 @@ +package io.metersphere.api.parser.api; + + +import com.fasterxml.jackson.core.JsonProcessingException; +import io.metersphere.api.dto.converter.ApiDefinitionDetail; +import io.metersphere.api.dto.converter.ApiImportFileParseResult; +import io.metersphere.api.dto.definition.ApiTestCaseDTO; +import io.metersphere.api.dto.request.ImportRequest; +import io.metersphere.api.parser.api.postman.PostmanCollection; +import io.metersphere.api.parser.api.postman.PostmanItem; +import io.metersphere.sdk.exception.MSException; +import io.metersphere.sdk.util.JSON; +import io.metersphere.sdk.util.LogUtils; +import io.metersphere.system.uid.IDGenerator; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import java.io.InputStream; +import java.util.*; + +public class PostmanParserApiDefinition extends PostmanAbstractParserParserApiDefinition { + + @Override + public ApiImportFileParseResult parse(InputStream source, ImportRequest request) throws JsonProcessingException { + LogUtils.info("PostmanParser parse"); + String testStr = getApiTestStr(source); + PostmanCollection postmanCollection = JSON.parseObject(testStr, PostmanCollection.class); + if (postmanCollection == null || postmanCollection.getItem() == null || postmanCollection.getItem().isEmpty() || postmanCollection.getInfo() == null){ + throw new MSException("Postman collection is empty"); + } + + String modulePath = null; + if (StringUtils.isNotBlank(postmanCollection.getInfo().getName())) { + modulePath = "/" + postmanCollection.getInfo().getName(); + } + LinkedHashMap> allImportDetails = this.parseItem(postmanCollection.getItem(), modulePath, request); + + // 对于postman的导入: 本质就是将postman的数据导入为用例 + ApiImportFileParseResult apiImport = this.genApiDefinitionImport(allImportDetails); + LogUtils.info("PostmanParser parse end"); + return apiImport; + } + + protected LinkedHashMap> parseItem(List items, String modulePath, ImportRequest request) { + LinkedHashMap> results = new LinkedHashMap<>(); + for (PostmanItem item : items) { + List childItems = item.getItem(); + if (childItems != null) { + String itemModulePath; + if (StringUtils.isNotBlank(modulePath) && StringUtils.isNotBlank(item.getName())) { + itemModulePath = modulePath + "/" + item.getName(); + } else { + itemModulePath = item.getName(); + } + results.putAll(parseItem(childItems, itemModulePath, request)); + } else { + results.putAll(parsePostman(item, modulePath, request)); + } + } + return results; + } + + private ApiImportFileParseResult genApiDefinitionImport(LinkedHashMap> allImportDetails) { + Map> groupWithUniqueIdentification = this.mergeApiCaseWithUniqueIdentification(allImportDetails); + ApiImportFileParseResult returnDTO = new ApiImportFileParseResult(); + groupWithUniqueIdentification.forEach((definitionImportDetail, caseData) -> { + String apiID = IDGenerator.nextStr(); + definitionImportDetail.setId(apiID); + List caseList = new ArrayList<>(); + caseData.forEach(item -> { + ApiTestCaseDTO apiTestCaseDTO = new ApiTestCaseDTO(); + apiTestCaseDTO.setName(item.getName()); + apiTestCaseDTO.setPriority("P0"); + apiTestCaseDTO.setStatus(item.getStatus()); + apiTestCaseDTO.setProjectId(item.getProjectId()); + apiTestCaseDTO.setApiDefinitionId(definitionImportDetail.getId()); + apiTestCaseDTO.setFollow(false); + apiTestCaseDTO.setMethod(item.getMethod()); + apiTestCaseDTO.setPath(item.getPath()); + apiTestCaseDTO.setRequest(item.getRequest()); + apiTestCaseDTO.setModulePath(item.getModulePath()); + apiTestCaseDTO.setModuleId(item.getModuleId()); + apiTestCaseDTO.setProtocol(item.getProtocol()); + apiTestCaseDTO.setProjectId(item.getProjectId()); + caseList.add(apiTestCaseDTO); + }); + returnDTO.getData().add(definitionImportDetail); + if (CollectionUtils.isNotEmpty(caseList)) { + returnDTO.getCaseMap().put(apiID, caseList); + } + }); + + return returnDTO; + } + + private Map> mergeApiCaseWithUniqueIdentification(LinkedHashMap> allImportDetails) { + Map> returnMap = new HashMap<>(); + Map filterApiMap = new HashMap<>(); + Map> uniqueCaseMap = new HashMap<>(); + allImportDetails.forEach((api, apiCase) -> { + String key = api.getMethod() + StringUtils.SPACE + api.getPath(); + if (!filterApiMap.containsKey(key)) { + filterApiMap.put(key, api); + } + if (uniqueCaseMap.containsKey(key)) { + uniqueCaseMap.get(key).addAll(apiCase); + } else { + uniqueCaseMap.put(key, apiCase); + } + }); + filterApiMap.forEach((key, api) -> { + returnMap.put(api, this.apiCaseRename(uniqueCaseMap.get(key))); + }); + return returnMap; + } + + private List apiCaseRename(List caseList) { + List returnList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(caseList)) { + List caseNameList = new ArrayList<>(); + for (ApiDefinitionDetail apiCase : caseList) { + String uniqueName = this.getUniqueName(apiCase.getName(), caseNameList); + apiCase.setName(uniqueName); + caseNameList.add(uniqueName); + returnList.add(apiCase); + } + } + return returnList; + } + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/Swagger3Parser.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/Swagger3ParserApiDefinition.java similarity index 94% rename from backend/services/api-test/src/main/java/io/metersphere/api/parser/api/Swagger3Parser.java rename to backend/services/api-test/src/main/java/io/metersphere/api/parser/api/Swagger3ParserApiDefinition.java index 9308b49a61..7e0feba1c1 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/Swagger3Parser.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/Swagger3ParserApiDefinition.java @@ -1,8 +1,8 @@ package io.metersphere.api.parser.api; import io.metersphere.api.constants.ApiConstants; -import io.metersphere.api.dto.converter.ApiDefinitionImport; -import io.metersphere.api.dto.converter.ApiDefinitionImportDetail; +import io.metersphere.api.dto.converter.ApiDefinitionDetail; +import io.metersphere.api.dto.converter.ApiImportFileParseResult; import io.metersphere.api.dto.definition.HttpResponse; import io.metersphere.api.dto.definition.ResponseBody; import io.metersphere.api.dto.request.ImportRequest; @@ -39,10 +39,12 @@ import org.springframework.http.HttpMethod; import org.springframework.http.MediaType; import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.URI; import java.util.*; -public class Swagger3Parser extends ApiImportAbstractParser { +public class Swagger3ParserApiDefinition extends HttpApiDefinitionImportAbstractParser { protected String projectId; private Components components; @@ -52,7 +54,31 @@ public class Swagger3Parser extends ApiImportAbstractParser public static final String COOKIE = "cookie"; public static final String QUERY = "query"; - public ApiDefinitionImport parse(InputStream source, ImportRequest request) throws Exception { + private void testUrlTimeout(String swaggerUrl) { + HttpURLConnection connection = null; + try { + URI uriObj = new URI(swaggerUrl); + connection = (HttpURLConnection) uriObj.toURL().openConnection(); + connection.setUseCaches(false); + connection.setConnectTimeout(3000); // 设置超时时间 + connection.connect(); // 建立连接 + } catch (Exception e) { + LogUtils.error(e); + throw new MSException(Translator.get("url_format_error")); + } finally { + if (connection != null) { + connection.disconnect(); // 关闭连接 + } + } + } + + public ApiImportFileParseResult parse(InputStream source, ImportRequest request) throws Exception { + + //将之前在service中的swagger地址判断放在这里。 + if (StringUtils.isNotBlank(request.getSwaggerUrl())) { + this.testUrlTimeout(request.getSwaggerUrl()); + } + LogUtils.info("Swagger3Parser parse"); List auths = setAuths(request); SwaggerParseResult result = null; @@ -75,10 +101,10 @@ public class Swagger3Parser extends ApiImportAbstractParser throw new MSException(Translator.get("swagger_parse_error")); } } - ApiDefinitionImport apiDefinitionImport = new ApiDefinitionImport(); + ApiImportFileParseResult apiImportFileParseResult = new ApiImportFileParseResult(); OpenAPI openAPI = result.getOpenAPI(); - apiDefinitionImport.setData(parseRequests(openAPI, request)); - return apiDefinitionImport; + apiImportFileParseResult.setData(parseRequests(openAPI, request)); + return apiImportFileParseResult; } private List setAuths(ImportRequest request) { @@ -95,7 +121,7 @@ public class Swagger3Parser extends ApiImportAbstractParser return CollectionUtils.size(auths) == 0 ? null : auths; } - private List parseRequests(OpenAPI openAPI, ImportRequest importRequest) { + private List parseRequests(OpenAPI openAPI, ImportRequest importRequest) { Paths paths = openAPI.getPaths(); @@ -103,7 +129,7 @@ public class Swagger3Parser extends ApiImportAbstractParser this.components = openAPI.getComponents(); - List results = new ArrayList<>(); + List results = new ArrayList<>(); for (String pathName : pathNames) { PathItem pathItem = paths.get(pathName); @@ -122,7 +148,7 @@ public class Swagger3Parser extends ApiImportAbstractParser Operation operation = operationsMap.get(method); if (operation != null) { //构建基本请求 - ApiDefinitionImportDetail apiDefinitionDTO = buildSwaggerApiDefinition(operation, pathName, method, importRequest); + ApiDefinitionDetail apiDefinitionDTO = buildSwaggerApiDefinition(operation, pathName, method, importRequest); //构建请求参数 MsHTTPElement request = buildHttpRequest(apiDefinitionDTO.getName(), pathName, method); parseParameters(operation, request); @@ -385,7 +411,7 @@ public class Swagger3Parser extends ApiImportAbstractParser return XMLUtil.jsonToPrettyXml(object); } - private ApiDefinitionImportDetail buildSwaggerApiDefinition(Operation operation, String path, String + private ApiDefinitionDetail buildSwaggerApiDefinition(Operation operation, String path, String method, ImportRequest importRequest) { String name; if (StringUtils.isNotBlank(operation.getSummary())) { diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/HarUtils.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/HarUtils.java new file mode 100644 index 0000000000..3bb71fe9a9 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/HarUtils.java @@ -0,0 +1,38 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har; + + +import com.google.gson.JsonSyntaxException; +import io.metersphere.api.parser.api.har.model.Har; +import io.metersphere.sdk.util.JSON; + +import java.io.IOException; +import java.io.InputStream; + +public class HarUtils { + + public static Har read(InputStream source) throws JsonSyntaxException, IOException { + if (source == null) { + throw new IllegalArgumentException("HAR Json cannot be null/empty"); + } + return JSON.parseObject(source, Har.class); + } +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/Har.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/Har.java new file mode 100644 index 0000000000..895f61b6a9 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/Har.java @@ -0,0 +1,30 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +public class Har { + + public HarLog log; + + @Override + public String toString() { + return "Har [log=" + log + "]"; + } +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarCache.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarCache.java new file mode 100644 index 0000000000..f89487a699 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarCache.java @@ -0,0 +1,30 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +public class HarCache { + + public HarCacheDetails beforeRequest; + + public HarCacheDetails afterRequest; + + public String comment; + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarCacheDetails.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarCacheDetails.java new file mode 100644 index 0000000000..052672abe7 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarCacheDetails.java @@ -0,0 +1,34 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +public class HarCacheDetails { + + public String expires; + + public String lastAccess; + + public String etag; + + public String hitCount; + + public String comment; + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarContent.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarContent.java new file mode 100644 index 0000000000..7aa2c9c98c --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarContent.java @@ -0,0 +1,36 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +public class HarContent { + + public long size; + + public String mimeType; + + public long compression; + + public String text; + + public String comment; + + public String encoding; + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarCookie.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarCookie.java new file mode 100644 index 0000000000..2263ecce06 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarCookie.java @@ -0,0 +1,65 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +public class HarCookie { + + public String name; + + public String value; + + public String path; + + public String expires; + + public boolean httpOnly; + + public boolean secure; + + public String comment; + + @Override + public String toString() { + return "[Cookie: " + this.name + "=" + this.value + "]"; + } + + @Override + public int hashCode() { + if (this.name == null) { + return -1; + } + + return this.name.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof HarCookie)) { + return false; + } + + if (this.name == null) { + return false; + } + + HarCookie harCookie = (HarCookie) obj; + return this.name.equals(harCookie.name); + } +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarCreator.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarCreator.java new file mode 100644 index 0000000000..2756ff8bab --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarCreator.java @@ -0,0 +1,36 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +public class HarCreator { + + public String name; + + public String version; + + public String comment; + + @Override + public String toString() { + return "HarCreator [name=" + name + ", version=" + version + ", comment=" + comment + "]"; + } + + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarEntry.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarEntry.java new file mode 100644 index 0000000000..96e12711f6 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarEntry.java @@ -0,0 +1,62 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +public class HarEntry implements Comparable { + + public String pageref; + + public String startedDateTime; + + public double time; + + public HarRequest request; + + public HarResponse response; + + public HarCache cache; + + public HarTiming timings; + + public String serverIPAddress; + + public String connection; + + public String comment; + + + @Override + public String toString() { + return "HarEntry [pageref=" + pageref + ", startedDateTime=" + startedDateTime + ", time=" + time + ", request=" + + request + ", response=" + response + ", cache=" + cache + ", timings=" + timings + + ", serverIPAddress=" + serverIPAddress + ", connection=" + connection + ", comment=" + comment + "]"; + } + + + @Override + public int compareTo(HarEntry o) { + if (o == null) { + return -1; + } + // parse the time and then return + return this.startedDateTime.compareTo(o.startedDateTime); + } + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarHeader.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarHeader.java new file mode 100644 index 0000000000..24e254d353 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarHeader.java @@ -0,0 +1,58 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +public class HarHeader { + + public String name; + + public String value; + + public String comment; + + @Override + public String toString() { + return "[Header: " + this.name + "=" + this.value + "]"; + } + + @Override + public int hashCode() { + if (this.name == null) { + return -1; + } + + return this.name.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof HarHeader)) { + return false; + } + + if (this.name == null) { + return false; + } + + HarHeader harHeader = (HarHeader) obj; + return this.name.equals(harHeader.name); + } + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarLog.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarLog.java new file mode 100644 index 0000000000..e53accaa35 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarLog.java @@ -0,0 +1,47 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +import java.util.List; + +public class HarLog { + + public static final String DEFAULT_HAR_VERSION = "1.2"; + + public String version = DEFAULT_HAR_VERSION; + + public HarCreator creator; + + public HarCreator browser; + + public List pages; + + public List entries; + + public String comment; + + @Override + public String toString() { + return "HarLog [version=" + version + ", creator=" + creator + ", browser=" + browser + ", pages=" + pages + + ", entries=" + entries + ", comment=" + comment + "]"; + } + + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarPage.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarPage.java new file mode 100644 index 0000000000..90d5abb3d2 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarPage.java @@ -0,0 +1,68 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +import java.util.List; + +public class HarPage { + + public String startedDateTime; + + public String id; + + public String title; + + public HarPageTiming pageTimings; + + public String comment; + + public transient List entries; + + + @Override + public String toString() { + return "HarPage [startedDateTime=" + startedDateTime + ", id=" + id + ", title=" + title + ", pageTimings=" + + pageTimings + ", comment=" + comment + "]"; + } + + @Override + public int hashCode() { + if (this.id == null) { + return -1; + } + + return this.id.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof HarPage)) { + return false; + } + + if (this.id == null) { + return false; + } + + HarPage harPage = (HarPage) obj; + return this.id.equals(harPage.id); + } + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarPageTiming.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarPageTiming.java new file mode 100644 index 0000000000..8874260c44 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarPageTiming.java @@ -0,0 +1,36 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +public class HarPageTiming { + + public double onContentLoad; + + public double onLoad; + + public String comment; + + @Override + public String toString() { + return "HarPageTiming [onContentLoad=" + onContentLoad + ", onLoad=" + onLoad + ", comment=" + comment + "]"; + } + + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarPostData.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarPostData.java new file mode 100644 index 0000000000..4d1cba6996 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarPostData.java @@ -0,0 +1,34 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +import java.util.List; + +public class HarPostData { + + public String mimeType; + + public List params; + + public String text; + + public String comment; + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarPostParam.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarPostParam.java new file mode 100644 index 0000000000..7126868c32 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarPostParam.java @@ -0,0 +1,62 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +public class HarPostParam { + + public String name; + + public String value; + + public String fileName; + + public String contentType; + + public String comment; + + @Override + public String toString() { + return "[Post Param: " + this.name + "=" + this.value + "]"; + } + + @Override + public int hashCode() { + if (this.name == null) { + return -1; + } + + return this.name.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof HarPostParam)) { + return false; + } + + if (this.name == null) { + return false; + } + + HarPostParam harPostParam = (HarPostParam) obj; + return this.name.equals(harPostParam.name); + } + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarQueryParam.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarQueryParam.java new file mode 100644 index 0000000000..4c4f7a0f51 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarQueryParam.java @@ -0,0 +1,58 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +public class HarQueryParam { + + public String name; + + public String value; + + public String comment; + + @Override + public String toString() { + return "[Query Param: " + this.name + "=" + this.value + "]"; + } + + @Override + public int hashCode() { + if (this.name == null) { + return -1; + } + + return this.name.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof HarQueryParam)) { + return false; + } + + if (this.name == null) { + return false; + } + + HarQueryParam harQueryParam = (HarQueryParam) obj; + return this.name.equals(harQueryParam.name); + } + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarRequest.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarRequest.java new file mode 100644 index 0000000000..4e9c5f08d1 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarRequest.java @@ -0,0 +1,53 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +import org.apache.commons.lang3.StringUtils; + +import java.util.List; + +public class HarRequest { + + public String method; + + public String url; + + public String httpVersion; + + public List cookies; + + public List headers; + + public List queryString; + + public HarPostData postData; + + public long headersSize; + + public long bodySize; + + public String comment; + + @Override + public String toString() { + return this.method + StringUtils.SPACE + this.url + StringUtils.SPACE + this.httpVersion; + } + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarResponse.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarResponse.java new file mode 100644 index 0000000000..de3b877ce7 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarResponse.java @@ -0,0 +1,49 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +import java.util.List; + +public class HarResponse { + + public int status; + + public String statusText; + + public String httpVersion; + + public List headers; + + public List cookies; + + public HarContent content; + + public String redirectURL; + + public long headersSize; + + public long bodySize; + + @Override + public String toString() { + return "HTTP " + this.status + " (" + this.statusText + ")"; + } + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarTiming.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarTiming.java new file mode 100644 index 0000000000..c4ea2a8ad3 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/har/model/HarTiming.java @@ -0,0 +1,47 @@ +/** + * har - HAR file reader, writer and viewer + * Copyright (c) 2014, Sandeep Gupta + *

+ * http://sangupta.com/projects/har + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.metersphere.api.parser.api.har.model; + +public class HarTiming { + + public double blocked; + + public double dns; + + public double connect; + + public double send; + + public double wait; + + public double receive; + + public double ssl; + + public String comment; + + @Override + public String toString() { + return "HarTiming [blocked=" + blocked + ", dns=" + dns + ", connect=" + connect + ", send=" + send + ", wait=" + + wait + ", receive=" + receive + ", ssl=" + ssl + ", comment=" + comment + "]"; + } + + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanResponse.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanResponse.java index d5b29e709f..f268607e33 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanResponse.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanResponse.java @@ -1,16 +1,16 @@ package io.metersphere.api.parser.api.postman; -import com.fasterxml.jackson.databind.JsonNode; import lombok.Data; -import java.util.List; - @Data public class PostmanResponse { private Integer code; private String name; - private String status; - private List header; - private JsonNode body; + private PostmanRequest originalRequest; + + //在要解析的postman文件中,response中的下面几个参数感觉没有用到。所以暂时注释 + // private String status; + // private List header; + // private JsonNode body; } 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 91b30cf131..1412136cdc 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 @@ -1,15 +1,13 @@ package io.metersphere.api.service.definition; -import io.metersphere.api.domain.ApiDefinition; -import io.metersphere.api.domain.ApiDefinitionExample; -import io.metersphere.api.domain.ApiDefinitionModule; -import io.metersphere.api.domain.ApiDefinitionModuleExample; +import io.metersphere.api.domain.*; import io.metersphere.api.dto.definition.ApiDefinitionBatchRequest; import io.metersphere.api.dto.definition.ApiDefinitionWithBlob; +import io.metersphere.api.dto.definition.ApiMockWithBlob; +import io.metersphere.api.dto.definition.ApiTestCaseWithBlob; import io.metersphere.api.dto.export.ApiExportResponse; -import io.metersphere.api.mapper.ApiDefinitionMapper; -import io.metersphere.api.mapper.ApiDefinitionModuleMapper; -import io.metersphere.api.mapper.ExtApiDefinitionMapper; +import io.metersphere.api.mapper.*; +import io.metersphere.api.parser.api.MetersphereExportParser; import io.metersphere.api.parser.api.Swagger3ExportParser; import io.metersphere.project.domain.Project; import io.metersphere.project.mapper.ProjectMapper; @@ -20,6 +18,7 @@ import jakarta.annotation.Resource; import org.apache.commons.collections.CollectionUtils; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -37,10 +36,15 @@ public class ApiDefinitionExportService { @Resource private ApiDefinitionModuleMapper apiDefinitionModuleMapper; @Resource + private ExtApiTestCaseMapper extApiTestCaseMapper; + @Resource + private ExtApiDefinitionMockMapper extApiDefinitionMockMapper; + @Resource private ProjectMapper projectMapper; @Resource private ApiDefinitionMapper apiDefinitionMapper; + public ApiExportResponse export(ApiDefinitionBatchRequest request, String type, String userId) { List ids = getBatchApiIds(request, request.getProjectId(), List.of(ModuleConstants.NODE_PROTOCOL_HTTP), false, userId); if (CollectionUtils.isEmpty(ids)) { @@ -52,13 +56,11 @@ public class ApiDefinitionExportService { example.createCriteria().andIdIn(moduleIds); List definitionModules = apiDefinitionModuleMapper.selectByExample(example); Map moduleMap = definitionModules.stream().collect(Collectors.toMap(ApiDefinitionModule::getId, ApiDefinitionModule::getName)); - switch (type) { - case "swagger": - return exportSwagger(request, list, moduleMap); - default: - return new ApiExportResponse(); - } - + return switch (type.toLowerCase()) { + case "swagger" -> exportSwagger(request, list, moduleMap); + case "metersphere" -> exportMetersphere(request, list, moduleMap); + default -> new ApiExportResponse(); + }; } private List getBatchApiIds(ApiDefinitionBatchRequest request, String projectId, List protocols, boolean deleted, String userId) { @@ -87,4 +89,25 @@ public class ApiDefinitionExportService { throw new MSException(e); } } + + @Resource + private ApiTestCaseBlobMapper apiTestCaseBlobMapper; + + private ApiExportResponse exportMetersphere(ApiDefinitionBatchRequest request, List list, Map moduleMap) { + try { + List apiIds = list.stream().map(ApiDefinitionWithBlob::getId).toList(); + List apiTestCaseWithBlobs = new ArrayList<>(); + List apiMockWithBlobs = new ArrayList<>(); + List apiTestCaseBlobs = new ArrayList<>(); + if (request.isExportApiCase()) { + apiTestCaseWithBlobs = extApiTestCaseMapper.selectAllDetailByApiIds(apiIds); + } + if (request.isExportApiMock()) { + apiMockWithBlobs = extApiDefinitionMockMapper.selectAllDetailByApiIds(apiIds); + } + return new MetersphereExportParser().parse(list, apiTestCaseWithBlobs, apiMockWithBlobs, moduleMap); + } catch (Exception e) { + throw new MSException(e); + } + } } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionImportService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionImportService.java index cb292f536c..6d29359882 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionImportService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionImportService.java @@ -2,26 +2,20 @@ package io.metersphere.api.service.definition; import io.metersphere.api.constants.ApiDefinitionStatus; import io.metersphere.api.constants.ApiImportPlatform; -import io.metersphere.api.domain.ApiDefinition; -import io.metersphere.api.domain.ApiDefinitionBlob; -import io.metersphere.api.domain.ApiDefinitionBlobExample; -import io.metersphere.api.domain.ApiDefinitionModule; -import io.metersphere.api.dto.converter.ApiDefinitionImport; -import io.metersphere.api.dto.converter.ApiDefinitionImportDetail; -import io.metersphere.api.dto.converter.ApiDetailWithData; -import io.metersphere.api.dto.converter.ApiDetailWithDataUpdate; -import io.metersphere.api.dto.definition.ApiDefinitionDTO; -import io.metersphere.api.dto.definition.ApiDefinitionPageRequest; -import io.metersphere.api.dto.definition.ApiModuleRequest; +import io.metersphere.api.domain.*; +import io.metersphere.api.dto.converter.*; +import io.metersphere.api.dto.definition.*; import io.metersphere.api.dto.request.ImportRequest; import io.metersphere.api.dto.request.http.MsHTTPElement; import io.metersphere.api.dto.request.http.MsHeader; import io.metersphere.api.dto.request.http.body.*; import io.metersphere.api.dto.schema.JsonSchemaItem; import io.metersphere.api.mapper.*; -import io.metersphere.api.parser.ImportParser; +import io.metersphere.api.parser.ApiDefinitionImportParser; import io.metersphere.api.parser.ImportParserFactory; import io.metersphere.api.utils.ApiDataUtils; +import io.metersphere.api.utils.ApiDefinitionImportUtils; +import io.metersphere.plugin.api.spi.AbstractMsTestElement; import io.metersphere.project.api.KeyValueEnableParam; import io.metersphere.project.constants.PropertyConstant; import io.metersphere.project.domain.Project; @@ -29,7 +23,6 @@ import io.metersphere.project.mapper.ExtBaseProjectVersionMapper; import io.metersphere.project.mapper.ProjectApplicationMapper; import io.metersphere.project.mapper.ProjectMapper; import io.metersphere.sdk.constants.ApplicationNumScope; -import io.metersphere.sdk.constants.HttpMethodConstants; import io.metersphere.sdk.constants.ModuleConstants; import io.metersphere.sdk.exception.MSException; import io.metersphere.sdk.util.*; @@ -45,9 +38,11 @@ import io.metersphere.system.notice.constants.NoticeConstants; import io.metersphere.system.service.CommonNoticeSendService; import io.metersphere.system.uid.IDGenerator; import io.metersphere.system.uid.NumGenerator; +import io.metersphere.system.utils.ServiceUtils; +import io.metersphere.system.utils.TreeNodeParseUtils; import jakarta.annotation.Resource; -import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.SqlSession; @@ -57,8 +52,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; -import java.net.HttpURLConnection; -import java.net.URI; import java.util.*; import java.util.stream.Collectors; @@ -84,6 +77,8 @@ public class ApiDefinitionImportService { @Resource private ApiDefinitionBlobMapper apiDefinitionBlobMapper; @Resource + private ApiTestCaseMapper apiTestCaseMapper; + @Resource private ApiDefinitionModuleService apiDefinitionModuleService; @Resource private ProjectMapper projectMapper; @@ -93,160 +88,70 @@ public class ApiDefinitionImportService { private CommonNoticeSendService commonNoticeSendService; @Resource private UserMapper userMapper; + @Resource + private ApiDefinitionModuleMapper apiDefinitionModuleMapper; + @Resource + private ApiDefinitionMockMapper apiDefinitionMockMapper; + @Resource + private ApiDefinitionMapper apiDefinitionMapper; - private static final String FILE_JMX = "jmx"; - private static final String FILE_HAR = "har"; - private static final String FILE_JSON = "json"; + private void initImportRequestAndCheck(MultipartFile file, ImportRequest request, String projectId) { + if (StringUtils.isBlank(request.getProjectId())) { + request.setProjectId(projectId); + } + //判断是否是定时任务进入 + if (StringUtils.equals(request.getType(), "SCHEDULE")) { + request.setProtocol(ModuleConstants.NODE_PROTOCOL_HTTP); + } - public void apiTestImport(MultipartFile file, ImportRequest request, String projectId) { if (file != null) { String originalFilename = file.getOriginalFilename(); if (StringUtils.isNotBlank(originalFilename)) { String suffixName = originalFilename.substring(originalFilename.indexOf(".") + 1); - this.checkFileSuffixName(request, suffixName); + ApiDefinitionImportUtils.checkFileSuffixName(request, suffixName); } } - if (StringUtils.isBlank(request.getProjectId())) { - request.setProjectId(projectId); - } - ImportParser runService = ImportParserFactory.getImportParser(request.getPlatform()); - ApiDefinitionImport apiImport = null; - if (StringUtils.equals(request.getType(), "SCHEDULE")) { - request.setProtocol(ModuleConstants.NODE_PROTOCOL_HTTP); - } - if (StringUtils.equals(request.getPlatform(), ApiImportPlatform.Swagger3.name()) && StringUtils.isNotBlank(request.getSwaggerUrl())) { - testUrlTimeout(request.getSwaggerUrl(), 30000); - } + } + + @Transactional(rollbackFor = Exception.class) + public void apiDefinitionImport(MultipartFile file, ImportRequest request, String projectId) { + this.initImportRequestAndCheck(file, request, projectId); + ApiDefinitionImportParser runService = ImportParserFactory.getImportParser(request.getPlatform()); + assert runService != null; + ApiImportDataAnalysisResult apiImportDataAnalysisResult; try { - apiImport = (ApiDefinitionImport) Objects.requireNonNull(runService).parse(file == null ? null : file.getInputStream(), request); - //TODO 处理mock数据 + //解析文件 + ApiImportFileParseResult fileParseResult = (ApiImportFileParseResult) runService.parse(file == null ? null : file.getInputStream(), request); + + ApiDefinitionPageRequest pageRequest = new ApiDefinitionPageRequest(); + pageRequest.setProjectId(request.getProjectId()); + pageRequest.setProtocols(Collections.singletonList(runService.getParseProtocol())); + List existenceApiDefinitionList = extApiDefinitionMapper.importList(pageRequest); + //分析有哪些数据需要新增、有哪些数据需要更新 + apiImportDataAnalysisResult = runService.generateInsertAndUpdateData(fileParseResult, existenceApiDefinitionList); } catch (Exception e) { LogUtils.error(e.getMessage(), e); throw new MSException(Translator.get("parse_data_error")); } try { - importApi(request, apiImport); + //初始化版本信息,用于保存,以及以后真对具体版本导入进行拓展 + String defaultVersion = extBaseProjectVersionMapper.getDefaultVersion(request.getProjectId()); + request.setDefaultVersion(defaultVersion); + if (request.getVersionId() == null) { + request.setVersionId(defaultVersion); + } + //通过导入配置,预处理数据,确定哪些要创建、哪些要修改 + ApiDefinitionPreImportAnalysisResult preImportAnalysisResult = this.preImportAnalysis(request, apiImportDataAnalysisResult); + //入库 + List operationLogs = this.insertData(preImportAnalysisResult, request); + operationLogService.batchAdd(operationLogs); } catch (Exception e) { LogUtils.error(e); throw new MSException(Translator.get("user_import_format_wrong")); } } - public static void testUrlTimeout(String address, int timeOutMillSeconds) { - HttpURLConnection connection = null; - try { - URI uriObj = new URI(address); - connection = (HttpURLConnection) uriObj.toURL().openConnection(); - connection.setUseCaches(false); - connection.setConnectTimeout(timeOutMillSeconds); // 设置超时时间 - connection.connect(); // 建立连接 - } catch (Exception e) { - LogUtils.error(e); - throw new MSException(Translator.get("url_format_error")); - } finally { - if (connection != null) { - connection.disconnect(); // 关闭连接 - } - } - } - - public void checkFileSuffixName(ImportRequest request, String suffixName) { - if (FILE_JMX.equalsIgnoreCase(suffixName)) { - if (!ApiImportPlatform.Jmeter.name().equalsIgnoreCase(request.getPlatform())) { - throw new MSException(Translator.get("file_format_does_not_meet_requirements")); - } - } - if (FILE_HAR.equalsIgnoreCase(suffixName)) { - if (!ApiImportPlatform.Har.name().equalsIgnoreCase(request.getPlatform())) { - throw new MSException(Translator.get("file_format_does_not_meet_requirements")); - } - } - if (FILE_JSON.equalsIgnoreCase(suffixName)) { - if (ApiImportPlatform.Har.name().equalsIgnoreCase(request.getPlatform()) || ApiImportPlatform.Jmeter.name().equalsIgnoreCase(request.getPlatform())) { - throw new MSException(Translator.get("file_format_does_not_meet_requirements")); - } - } - } - - public void importApi(ImportRequest request, ApiDefinitionImport apiImport) { - String defaultVersion = extBaseProjectVersionMapper.getDefaultVersion(request.getProjectId()); - request.setDefaultVersion(defaultVersion); - if (request.getVersionId() == null) { - request.setVersionId(defaultVersion); - } - List initData = apiImport.getData(); - - //TODO 查询项目菜单参数 - /*ProjectApplicationExample applicationExample = new ProjectApplicationExample(); - applicationExample.createCriteria().andProjectIdEqualTo(request.getProjectId()).andTypeEqualTo("API_URL_REPEATABLE"); - List projectApplications = projectApplicationMapper.selectByExample(applicationExample); - if (CollectionUtils.isNotEmpty(projectApplications)) { - String typeValue = projectApplications.getFirst().getTypeValue(); - }*/ - //过滤(一次只导入一个协议) - List filterData = initData.stream().filter(t -> t.getProtocol().equals(request.getProtocol())).collect(Collectors.toList()); - if (filterData.isEmpty()) { - return; - } - - //处理数据,判断数据是否重复 - dealWithData(request, filterData); - - } - - private void dealWithData(ImportRequest request, List importData) { - //查询数据库中所有的数据, 用于判断是否重复 - ApiDefinitionPageRequest pageRequest = new ApiDefinitionPageRequest(); - pageRequest.setProjectId(request.getProjectId()); - pageRequest.setProtocols(List.of(request.getProtocol())); - //TODO 如果是有版本的话 需要加上版本的判断 - List apiLists = extApiDefinitionMapper.importList(pageRequest); - List apiModules = this.buildTreeData(request.getProjectId(), request.getProtocol()); - //将apiModules转换成新的map 要求key是attachInfo中的modulePath 使用stream实现 - Map modulePathMap = apiModules.stream().collect(Collectors.toMap(BaseTreeNode::getPath, t -> t)); - Map idModuleMap = apiModules.stream().collect(Collectors.toMap(BaseTreeNode::getId, apiModuleDTO -> apiModuleDTO)); - //如果导入的时候选择了模块,需要把所有的导入数据的模块路径前面拼接上选择的模块路径 - if (StringUtils.isNotBlank(request.getModuleId())) { - BaseTreeNode baseTreeNode = idModuleMap.get(request.getModuleId()); - if (baseTreeNode != null) { - String modulePath = baseTreeNode.getPath(); - //如果选择了未规划模块, 导入的数据的模块清空, 只导入数据,不处理模块信息 - if ("root".equals(request.getModuleId())) { - importData.forEach(t -> { - t.setModulePath(modulePath); - }); - } else { - importData.forEach(t -> { - t.setModulePath(modulePath + t.getModulePath()); - }); - } - } - } - //去掉apiLists中不存在的模块数据 - apiLists.forEach(t -> { - t.setModulePath(idModuleMap.get(t.getModuleId()) != null ? idModuleMap.get(t.getModuleId()).getPath() : StringUtils.EMPTY); - }); - apiLists = apiLists.stream().filter(t -> modulePathMap.containsKey(t.getModulePath())).toList(); - ApiDetailWithData apiDealWithData = new ApiDetailWithData(); - //判断数据是否是唯一的 - checkApiDataOnly(request, importData, apiLists, apiDealWithData); - - ApiDetailWithDataUpdate apiDetailWithDataUpdate = new ApiDetailWithDataUpdate(); - getNeedUpdateData(request, apiDealWithData, apiDetailWithDataUpdate); - - List operationLogs = new ArrayList<>(); - //数据入库 - insertData(modulePathMap, idModuleMap, apiDetailWithDataUpdate, request, operationLogs); - - batchSaveLog(operationLogs); - } - - @Transactional(rollbackFor = Exception.class) - public void batchSaveLog(List operationLogs) { - operationLogService.batchAdd(operationLogs); - } - public Long getNextOrder(String projectId) { Long pos = extApiDefinitionMapper.getPos(projectId); return (pos == null ? 0 : pos) + DEFAULT_NODE_INTERVAL_POS; @@ -262,16 +167,6 @@ public class ApiDefinitionImportService { return order; } - /* public Long getImportNextCaseOrder(String projectId) { - Long order = currentApiCaseOrder.get(); - if (order == null) { - order = apiTestCaseService.getNextOrder(projectId); - } - order = order + ORDER_STEP; - currentApiCaseOrder.set(order); - return order; - }*/ - public Long getImportNextModuleOrder(String projectId) { Long order = currentModuleOrder.get(); if (order == null) { @@ -282,114 +177,101 @@ public class ApiDefinitionImportService { return order; } - @Transactional(rollbackFor = Exception.class) - public void insertData(Map modulePathMap, - Map idModuleMap, - ApiDetailWithDataUpdate apiDetailWithDataUpdate, - ImportRequest request, - List operationLogs) { - //先判断是否需要新增模块 - List addModuleData = apiDetailWithDataUpdate.getAddModuleData(); - List updateModuleData = apiDetailWithDataUpdate.getUpdateModuleData(); - //取addModuleData的模块放到set中 生成一个新的set - Set moduleSet = addModuleData.stream().map(ApiDefinitionImportDetail::getModulePath).collect(Collectors.toSet()); - //取updateModuleData的模块放到set中 生成一个新的set - Set updateModuleSet = updateModuleData.stream().map(ApiDefinitionImportDetail::getModulePath).collect(Collectors.toSet()); - moduleSet.addAll(updateModuleSet); - //将modulePathMap的key转成set - Set modulePathSet = modulePathMap.keySet(); - //取modulePathSet中不存在的 - Set differenceSet = moduleSet.stream().filter(t -> !modulePathSet.contains(t)).collect(Collectors.toSet()); - //不存在的需要新增 - List addModuleList = new ArrayList<>(); - + public List insertData( + ApiDefinitionPreImportAnalysisResult apiDefinitionPreImportAnalysisResult, + ImportRequest request) { + List operationLogs = new ArrayList<>(); currentApiCaseOrder.remove(); currentApiOrder.remove(); currentModuleOrder.remove(); - //获取需要新增的模块 - getNeedAddModule(modulePathMap, idModuleMap, differenceSet, addModuleList); - SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH); - ApiDefinitionModuleMapper moduleMapper = sqlSession.getMapper(ApiDefinitionModuleMapper.class); - ApiDefinitionMapper apiMapper = sqlSession.getMapper(ApiDefinitionMapper.class); - ApiDefinitionBlobMapper apiBlobMapper = sqlSession.getMapper(ApiDefinitionBlobMapper.class); + //更新、修改数据 + { + SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH); + ApiDefinitionModuleMapper batchApiModuleMapper = sqlSession.getMapper(ApiDefinitionModuleMapper.class); + ApiDefinitionMapper batchApiDefinitionMapper = sqlSession.getMapper(ApiDefinitionMapper.class); + ApiDefinitionBlobMapper batchApiBlobMapper = sqlSession.getMapper(ApiDefinitionBlobMapper.class); + ApiTestCaseMapper batchApiCaseMapper = sqlSession.getMapper(ApiTestCaseMapper.class); + ApiTestCaseBlobMapper batchApiCaseBlobMapper = sqlSession.getMapper(ApiTestCaseBlobMapper.class); + ApiDefinitionMockMapper batchApiMockMapper = sqlSession.getMapper(ApiDefinitionMockMapper.class); + ApiDefinitionMockConfigMapper batchApiMockConfigMapper = sqlSession.getMapper(ApiDefinitionMockConfigMapper.class); - //创建模块 - insertModule(request, addModuleList, moduleMapper, sqlSession); + insertModule(request, apiDefinitionPreImportAnalysisResult.getInsertModuleList(), batchApiModuleMapper, sqlSession); + updateApiDefinitionModule(request, apiDefinitionPreImportAnalysisResult.getUpdateModuleApiList(), batchApiDefinitionMapper, sqlSession); + updateApiDefinition(request, apiDefinitionPreImportAnalysisResult.getUpdateApiData(), batchApiDefinitionMapper, batchApiBlobMapper, sqlSession); + insertApiDefinition(request, apiDefinitionPreImportAnalysisResult.getInsertApiData(), batchApiDefinitionMapper, batchApiBlobMapper, sqlSession); + insertApiTestCase(request, apiDefinitionPreImportAnalysisResult.getInsertApiCaseList(), batchApiCaseMapper, batchApiCaseBlobMapper, sqlSession); + updateApiTestCase(request, apiDefinitionPreImportAnalysisResult.getUpdateApiCaseList(), batchApiCaseMapper, batchApiCaseBlobMapper, sqlSession); + insertApiMock(request, apiDefinitionPreImportAnalysisResult.getInsertApiMockList(), batchApiDefinitionMapper, batchApiMockMapper, batchApiMockConfigMapper, sqlSession); + updateApiMock(request, apiDefinitionPreImportAnalysisResult.getUpdateApiMockList(), batchApiMockMapper, batchApiMockConfigMapper, sqlSession); - //更新模块数据 - updateApiModule(modulePathMap, request, updateModuleData, apiMapper, sqlSession); + sqlSession.flushStatements(); + SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory); + } + //记录log以及发送通知 + { + Project project = projectMapper.selectByPrimaryKey(request.getProjectId()); + List noticeCreateLists = new ArrayList<>(); + List noticeUpdateLists = new ArrayList<>(); + apiDefinitionPreImportAnalysisResult.getInsertModuleList().forEach(t -> { + operationLogs.add(ApiDefinitionImportUtils.genImportLog(project, t.getId(), t.getName(), t, OperationLogModule.API_TEST_MANAGEMENT_MODULE, request.getUserId(), OperationLogType.UPDATE.name())); + }); - List updateRequestData = apiDetailWithDataUpdate.getUpdateRequestData(); + apiDefinitionPreImportAnalysisResult.getUpdateModuleApiList().forEach(t -> { + ApiDefinitionDTO apiDefinitionDTO = new ApiDefinitionDTO(); + BeanUtils.copyBean(apiDefinitionDTO, t); + ApiDefinitionCaseDTO apiDefinitionCaseDTO = new ApiDefinitionCaseDTO(); + BeanUtils.copyBean(apiDefinitionCaseDTO, apiDefinitionDTO); + noticeUpdateLists.add(apiDefinitionCaseDTO); + operationLogs.add(ApiDefinitionImportUtils.genImportLog(project, t.getId(), t.getName(), apiDefinitionDTO, OperationLogModule.API_TEST_MANAGEMENT_DEFINITION, request.getUserId(), OperationLogType.UPDATE.name())); + }); + apiDefinitionPreImportAnalysisResult.getUpdateApiData().forEach(t -> { + ApiDefinitionDTO apiDefinitionDTO = new ApiDefinitionDTO(); + BeanUtils.copyBean(apiDefinitionDTO, t); + ApiDefinitionCaseDTO apiDefinitionCaseDTO = new ApiDefinitionCaseDTO(); + BeanUtils.copyBean(apiDefinitionCaseDTO, apiDefinitionDTO); + noticeUpdateLists.add(apiDefinitionCaseDTO); + operationLogs.add(ApiDefinitionImportUtils.genImportLog(project, t.getId(), t.getName(), apiDefinitionDTO, OperationLogModule.API_TEST_MANAGEMENT_DEFINITION, request.getUserId(), OperationLogType.UPDATE.name())); + }); + apiDefinitionPreImportAnalysisResult.getInsertApiData().forEach(t -> { + ApiDefinitionDTO apiDefinitionDTO = new ApiDefinitionDTO(); + BeanUtils.copyBean(apiDefinitionDTO, t); + ApiDefinitionCaseDTO apiDefinitionCaseDTO = new ApiDefinitionCaseDTO(); + BeanUtils.copyBean(apiDefinitionCaseDTO, apiDefinitionDTO); + noticeCreateLists.add(apiDefinitionCaseDTO); + operationLogs.add(ApiDefinitionImportUtils.genImportLog(project, t.getId(), t.getName(), apiDefinitionDTO, OperationLogModule.API_TEST_MANAGEMENT_DEFINITION, request.getUserId(), OperationLogType.IMPORT.name())); + }); - //更新接口请求数据 - updateApiRequest(request, updateRequestData, apiMapper, apiBlobMapper, sqlSession); - - Map logData = apiDetailWithDataUpdate.getLogData(); - Project project = projectMapper.selectByPrimaryKey(request.getProjectId()); - List updateLists = new ArrayList<>(); - //获取更新的日志 - apiUpdateLog(request, logData, updateLists, project, operationLogs); - - List createLists = new ArrayList<>(); - //获取新增的数据和日志 - addApiAndLog(modulePathMap, request, addModuleData, apiMapper, apiBlobMapper, project, operationLogs, createLists); - - sqlSession.flushStatements(); - SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory); - //发送通知 - List createResources = new ArrayList<>(JSON.parseArray(JSON.toJSONString(createLists), Map.class)); - User user = userMapper.selectByPrimaryKey(request.getUserId()); - commonNoticeSendService.sendNotice(NoticeConstants.TaskType.API_DEFINITION_TASK, NoticeConstants.Event.CREATE, createResources, user, request.getProjectId()); - List updateResources = new ArrayList<>(JSON.parseArray(JSON.toJSONString(updateLists), Map.class)); - commonNoticeSendService.sendNotice(NoticeConstants.TaskType.API_DEFINITION_TASK, NoticeConstants.Event.UPDATE, updateResources, user, request.getProjectId()); + //发送通知 + List createResources = new ArrayList<>(JSON.parseArray(JSON.toJSONString(noticeCreateLists), Map.class)); + User user = userMapper.selectByPrimaryKey(request.getUserId()); + commonNoticeSendService.sendNotice(NoticeConstants.TaskType.API_DEFINITION_TASK, NoticeConstants.Event.CREATE, createResources, user, request.getProjectId()); + List updateResources = new ArrayList<>(JSON.parseArray(JSON.toJSONString(noticeUpdateLists), Map.class)); + commonNoticeSendService.sendNotice(NoticeConstants.TaskType.API_DEFINITION_TASK, NoticeConstants.Event.UPDATE, updateResources, user, request.getProjectId()); + } + return operationLogs; } - private static void getNeedAddModule(Map modulePathMap, Map idModuleMap, Set differenceSet, List addModuleList) { - differenceSet.forEach(item -> { - //解析modulePath 格式为/a/b/c - String[] split = item.split("/"); - //一层一层的创建 - for (int i = 1; i < split.length; i++) { - String modulePath = StringUtils.join(split, "/", 1, i + 1); - String path = StringUtils.join("/", modulePath); - BaseTreeNode baseTreeNode = modulePathMap.get(path); - if (baseTreeNode == null) { - //创建模块 - BaseTreeNode module = new BaseTreeNode(); - module.setId(IDGenerator.nextStr()); - module.setName(split[i]); - if (i != 1) { - String parentId = path.substring(0, path.lastIndexOf("/" + split[i])); - module.setParentId(modulePathMap.get(parentId).getId()); - } - module.setPath(path); - addModuleList.add(module); - modulePathMap.put(path, module); - idModuleMap.put(module.getId(), module); - } - } - }); - } - - private void addApiAndLog(Map modulePathMap, ImportRequest request, List addModuleData, ApiDefinitionMapper apiMapper, ApiDefinitionBlobMapper apiBlobMapper, Project project, List operationLogs, List createLists) { - addModuleData.forEach(t -> { + private void insertApiDefinition(ImportRequest request, List insertApiData, ApiDefinitionMapper apiMapper, ApiDefinitionBlobMapper apiBlobMapper, SqlSession sqlSession) { + insertApiData.forEach(t -> { ApiDefinition apiDefinition = new ApiDefinition(); BeanUtils.copyBean(apiDefinition, t); - apiDefinition.setId(IDGenerator.nextStr()); - apiDefinition.setModuleId(modulePathMap.get(t.getModulePath()).getId()); + if (StringUtils.isEmpty(apiDefinition.getId())) { + // 部分文件导入时不会预先设置id + apiDefinition.setId(IDGenerator.nextStr()); + } + apiDefinition.setProjectId(request.getProjectId()); - apiDefinition.setProtocol(request.getProtocol()); - apiDefinition.setCreateUser(request.getUserId()); apiDefinition.setPos(getImportNextOrder(request.getProjectId())); - apiDefinition.setCreateTime(System.currentTimeMillis()); - apiDefinition.setUpdateUser(request.getUserId()); - apiDefinition.setUpdateTime(System.currentTimeMillis()); apiDefinition.setNum(NumGenerator.nextNum(request.getProjectId(), ApplicationNumScope.API_DEFINITION)); apiDefinition.setLatest(true); apiDefinition.setStatus(ApiDefinitionStatus.PROCESSING.name()); apiDefinition.setRefId(apiDefinition.getId()); apiDefinition.setVersionId(request.getVersionId()); + apiDefinition.setCreateUser(request.getUserId()); + apiDefinition.setCreateTime(System.currentTimeMillis()); + apiDefinition.setUpdateUser(request.getUserId()); + apiDefinition.setUpdateTime(System.currentTimeMillis()); apiMapper.insertSelective(apiDefinition); //插入blob数据 ApiDefinitionBlob apiDefinitionBlob = new ApiDefinitionBlob(); @@ -397,60 +279,81 @@ public class ApiDefinitionImportService { apiDefinitionBlob.setRequest(JSON.toJSONBytes(t.getRequest())); apiDefinitionBlob.setResponse(JSON.toJSONBytes(t.getResponse())); apiBlobMapper.insertSelective(apiDefinitionBlob); - ApiDefinitionDTO apiDefinitionDTO = new ApiDefinitionDTO(); - BeanUtils.copyBean(apiDefinitionDTO, t); - LogDTO dto = new LogDTO( - project.getId(), - project.getOrganizationId(), - apiDefinition.getId(), - request.getUserId(), - OperationLogType.IMPORT.name(), - OperationLogModule.API_TEST_MANAGEMENT_DEFINITION, - t.getName()); - dto.setHistory(true); - dto.setPath("/api/definition/import"); - dto.setMethod(HttpMethodConstants.POST.name()); - dto.setOriginalValue(JSON.toJSONBytes(apiDefinitionDTO)); - operationLogs.add(dto); - - ApiDefinitionCaseDTO apiDefinitionCaseDTO = new ApiDefinitionCaseDTO(); - BeanUtils.copyBean(apiDefinitionCaseDTO, apiDefinitionDTO); - createLists.add(apiDefinitionCaseDTO); }); + sqlSession.flushStatements(); } - private static void apiUpdateLog(ImportRequest request, Map logData, List updateLists, Project project, List operationLogs) { - if (MapUtils.isNotEmpty(logData)) { - logData.forEach((k, v) -> { - ApiDefinitionDTO apiDefinitionDTO = new ApiDefinitionDTO(); - BeanUtils.copyBean(apiDefinitionDTO, v); - ApiDefinitionCaseDTO apiDefinitionCaseDTO = new ApiDefinitionCaseDTO(); - BeanUtils.copyBean(apiDefinitionCaseDTO, v); - updateLists.add(apiDefinitionCaseDTO); - LogDTO dto = new LogDTO( - project.getId(), - project.getOrganizationId(), - v.getId(), - request.getUserId(), - OperationLogType.UPDATE.name(), - OperationLogModule.API_TEST_MANAGEMENT_DEFINITION, - v.getName()); - dto.setHistory(true); - dto.setPath("/api/definition/import"); - dto.setMethod(HttpMethodConstants.POST.name()); - dto.setOriginalValue(JSON.toJSONBytes(apiDefinitionDTO)); - operationLogs.add(dto); - }); - } + private void insertApiTestCase(ImportRequest request, List insertApiCaseData, ApiTestCaseMapper apiTestCaseMapper, ApiTestCaseBlobMapper apiTestCaseBlobMapper, SqlSession sqlSession) { + insertApiCaseData.forEach(t -> { + ApiTestCase apiTestCase = new ApiTestCase(); + BeanUtils.copyBean(apiTestCase, t); + apiTestCase.setId(IDGenerator.nextStr()); + apiTestCase.setProjectId(request.getProjectId()); + apiTestCase.setPos(getImportNextOrder(request.getProjectId())); + apiTestCase.setNum(NumGenerator.nextNum(request.getProjectId(), ApplicationNumScope.API_DEFINITION)); + apiTestCase.setStatus(ApiDefinitionStatus.PROCESSING.name()); + apiTestCase.setVersionId(request.getVersionId()); + apiTestCase.setCreateUser(request.getUserId()); + apiTestCase.setCreateTime(System.currentTimeMillis()); + apiTestCase.setUpdateUser(request.getUserId()); + apiTestCase.setUpdateTime(System.currentTimeMillis()); + apiTestCaseMapper.insertSelective(apiTestCase); + //插入blob数据 + ApiTestCaseBlob apiTestCaseBlob = new ApiTestCaseBlob(); + apiTestCaseBlob.setId(apiTestCase.getId()); + + apiTestCaseBlob.setRequest(getMsTestElementStr(t.getRequest()).getBytes()); + apiTestCaseBlobMapper.insertSelective(apiTestCaseBlob); + }); + sqlSession.flushStatements(); } - private static void updateApiRequest(ImportRequest request, List updateRequestData, ApiDefinitionMapper apiMapper, ApiDefinitionBlobMapper apiBlobMapper, SqlSession sqlSession) { + private void insertApiMock(ImportRequest request, List insertMockList, ApiDefinitionMapper batchApiMapper, ApiDefinitionMockMapper batchMockMapper, ApiDefinitionMockConfigMapper batchMockConfigMapper, SqlSession sqlSession) { + Map apiDefinitionIdMap = new HashMap<>(); + + insertMockList.forEach(t -> { + ApiDefinition api = apiDefinitionIdMap.get(t.getApiDefinitionId()); + if (api == null) { + api = batchApiMapper.selectByPrimaryKey(t.getApiDefinitionId()); + apiDefinitionIdMap.put(t.getApiDefinitionId(), api); + } + ApiDefinitionMock apiMock = new ApiDefinitionMock(); + BeanUtils.copyBean(apiMock, t); + apiMock.setId(IDGenerator.nextStr()); + apiMock.setProjectId(request.getProjectId()); + apiMock.setExpectNum(String.valueOf(NumGenerator.nextNum(request.getProjectId() + "_" + api.getNum(), ApplicationNumScope.API_MOCK))); + apiMock.setVersionId(request.getVersionId()); + apiMock.setCreateUser(request.getUserId()); + apiMock.setCreateTime(System.currentTimeMillis()); + apiMock.setUpdateUser(request.getUserId()); + apiMock.setUpdateTime(System.currentTimeMillis()); + batchMockMapper.insertSelective(apiMock); + //插入blob数据 + ApiDefinitionMockConfig mockConfig = new ApiDefinitionMockConfig(); + mockConfig.setId(apiMock.getId()); + mockConfig.setMatching(JSON.toJSONString(t.getMockMatchRule()).getBytes()); + mockConfig.setResponse(JSON.toJSONString(t.getResponse()).getBytes()); + batchMockConfigMapper.insertSelective(mockConfig); + }); + sqlSession.flushStatements(); + } + + private String getMsTestElementStr(Object request) { + String requestStr = JSON.toJSONString(request); + AbstractMsTestElement msTestElement = ApiDataUtils.parseObject(requestStr, AbstractMsTestElement.class); + // 手动校验参数 + ServiceUtils.validateParam(msTestElement); + return requestStr; + } + + private static void updateApiDefinition(ImportRequest request, List updateRequestData, ApiDefinitionMapper apiMapper, ApiDefinitionBlobMapper apiBlobMapper, SqlSession sqlSession) { SubListUtils.dealForSubList(updateRequestData, 100, list -> { list.forEach(t -> { ApiDefinition apiDefinition = new ApiDefinition(); apiDefinition.setId(t.getId()); apiDefinition.setUpdateUser(request.getUserId()); apiDefinition.setUpdateTime(System.currentTimeMillis()); + apiDefinition.setModuleId(t.getModuleId()); apiMapper.updateByPrimaryKeySelective(apiDefinition); //更新blob数据 ApiDefinitionBlob apiDefinitionBlob = new ApiDefinitionBlob(); @@ -463,12 +366,49 @@ public class ApiDefinitionImportService { }); } - private static void updateApiModule(Map modulePathMap, ImportRequest request, List updateModuleData, ApiDefinitionMapper apiMapper, SqlSession sqlSession) { + private static void updateApiTestCase(ImportRequest request, List updateApiTestCaseData, ApiTestCaseMapper apiTestCaseMapper, ApiTestCaseBlobMapper apiTestCaseBlobMapper, SqlSession sqlSession) { + SubListUtils.dealForSubList(updateApiTestCaseData, 100, list -> { + list.forEach(t -> { + ApiTestCase apiTestCase = new ApiTestCase(); + apiTestCase.setId(t.getId()); + apiTestCase.setUpdateUser(request.getUserId()); + apiTestCase.setUpdateTime(System.currentTimeMillis()); + apiTestCaseMapper.updateByPrimaryKeySelective(apiTestCase); + //更新blob数据 + ApiTestCaseBlob apiDefinitionBlob = new ApiTestCaseBlob(); + apiDefinitionBlob.setId(t.getId()); + apiDefinitionBlob.setRequest(JSON.toJSONBytes(t.getRequest())); + apiTestCaseBlobMapper.updateByPrimaryKeySelective(apiDefinitionBlob); + }); + sqlSession.flushStatements(); + }); + } + + private static void updateApiMock(ImportRequest request, List updateApiTestCaseData, ApiDefinitionMockMapper batchMockMapper, ApiDefinitionMockConfigMapper batchMockConfigMapper, SqlSession sqlSession) { + SubListUtils.dealForSubList(updateApiTestCaseData, 100, list -> { + list.forEach(t -> { + ApiDefinitionMock apiMock = new ApiDefinitionMock(); + apiMock.setId(t.getId()); + apiMock.setUpdateUser(request.getUserId()); + apiMock.setUpdateTime(System.currentTimeMillis()); + batchMockMapper.updateByPrimaryKeySelective(apiMock); + //更新blob数据 + ApiDefinitionMockConfig mockConfig = new ApiDefinitionMockConfig(); + mockConfig.setId(apiMock.getId()); + mockConfig.setMatching(JSON.toJSONString(t.getMockMatchRule()).getBytes()); + mockConfig.setResponse(JSON.toJSONString(t.getResponse()).getBytes()); + batchMockConfigMapper.updateByPrimaryKeySelective(mockConfig); + }); + sqlSession.flushStatements(); + }); + } + + private static void updateApiDefinitionModule(ImportRequest request, List updateModuleData, ApiDefinitionMapper apiMapper, SqlSession sqlSession) { SubListUtils.dealForSubList(updateModuleData, 100, list -> { list.forEach(t -> { ApiDefinition apiDefinition = new ApiDefinition(); apiDefinition.setId(t.getId()); - apiDefinition.setModuleId(modulePathMap.get(t.getModulePath()).getId()); + apiDefinition.setModuleId(t.getModuleId()); apiDefinition.setUpdateUser(request.getUserId()); apiDefinition.setUpdateTime(System.currentTimeMillis()); apiMapper.updateByPrimaryKeySelective(apiDefinition); @@ -496,97 +436,300 @@ public class ApiDefinitionImportService { }); } - private void getNeedUpdateData(ImportRequest request, ApiDetailWithData apiDetailWithData, ApiDetailWithDataUpdate apiDetailWithDataUpdate) { - List sameList = apiDetailWithData.getSameList(); - List differenceList = apiDetailWithData.getDifferenceList(); - Map apiDateMap = apiDetailWithData.getApiDateMap(); - Map importDataMap = apiDetailWithData.getImportDataMap(); - List updateModuleData = new ArrayList<>(); - List updateRequestData = new ArrayList<>(); - List addData = new ArrayList<>(); - Map logMap = new HashMap<>(); - //判断参数是否一样 一样的参数需要判断是否需要覆盖模块 如果需要就要update数据, 如果不需要 就直接跳过 - if (CollectionUtils.isNotEmpty(sameList) && getFullCoverage(request.getCoverData())) { - //需要覆盖数据的 会判断是否需要覆盖模块 - List sameData = sameList.stream().map(apiDateMap::get).toList(); - //取所有id为新的list 需要取查询blob的数据 - List sameIds = sameData.stream().map(ApiDefinitionImportDetail::getId).toList(); - ApiDefinitionBlobExample blobExample = new ApiDefinitionBlobExample(); - blobExample.createCriteria().andIdIn(sameIds); - List apiDefinitionBlobs = apiDefinitionBlobMapper.selectByExampleWithBLOBs(blobExample); - Map blobMap = apiDefinitionBlobs.stream().collect(Collectors.toMap(ApiDefinitionBlob::getId, t -> t)); - //判断参数是否一样 - for (ApiDefinitionImportDetail apiDefinitionDTO : sameData) { - ApiDefinitionImportDetail importDTO = importDataMap.get(apiDefinitionDTO.getMethod() + apiDefinitionDTO.getPath()); - ApiDefinitionBlob apiDefinitionBlob = blobMap.get(apiDefinitionDTO.getId()); - if (apiDefinitionBlob != null) { - MsHTTPElement dbRequest = ApiDataUtils.parseObject(new String(apiDefinitionBlob.getRequest()), MsHTTPElement.class); - //判断参数是否一样 参数类型有 请求头 请求参数 请求体 - boolean isSame = dataIsSame(dbRequest, (MsHTTPElement) importDTO.getRequest()); - //判断是否开启模块覆盖 - if (getFullCoverage(request.getCoverModule())) { - //判断模块是否一样 - if (!StringUtils.equals(apiDefinitionDTO.getModulePath(), importDTO.getModulePath())) { - //不一样的模块需要更 - apiDefinitionDTO.setModulePath(importDTO.getModulePath()); - updateModuleData.add(apiDefinitionDTO); - logMap.put(apiDefinitionDTO.getId(), importDTO); - } + /** + * 预导入数据分析 根据请求配置,判断哪些数据新增、哪些数据修改且修改它的哪部分数据、 + */ + private ApiDefinitionPreImportAnalysisResult preImportAnalysis(ImportRequest request, ApiImportDataAnalysisResult insertAndUpdateData) { + ApiDefinitionPreImportAnalysisResult preImportAnalysisResult = new ApiDefinitionPreImportAnalysisResult(); + + // api模块树查询 + List apiModules = this.buildTreeData(request.getProjectId(), request.getProtocol()); + Map modulePathMap = apiModules.stream().collect(Collectors.toMap(BaseTreeNode::getPath, t -> t)); + // 新增数据处理 + this.inertDataAnalysis(preImportAnalysisResult, request, modulePathMap, insertAndUpdateData); + + // 已有数据处理 + this.existenceDataAnalysis(preImportAnalysisResult, request, modulePathMap, insertAndUpdateData); + + return preImportAnalysisResult; + } + + /* + 新增数据准备 + 指定了导入模块: 直接塞入指定模块中。 + 未指定导入模块: 接口有模块,就放在那个模块下。 接口没模块就放在未规划模块内 + */ + private void inertDataAnalysis(ApiDefinitionPreImportAnalysisResult apiDefinitionPreImportAnalysisResult, ImportRequest request, Map modulePathMap, ApiImportDataAnalysisResult analysisResult) { + for (ApiDefinitionDetail apiData : analysisResult.getInsertApiList()) { + if (StringUtils.isNotEmpty(request.getModuleId())) { + // 指定了导入模块: 直接塞入指定模块中。 + apiData.setModuleId(request.getModuleId()); + } else { + // 未指定导入模块: 接口有模块,就放在那个模块下。 接口没模块就放在未规划模块内 + if (StringUtils.isEmpty(apiData.getModulePath())) { + apiData.setModuleId(ModuleConstants.DEFAULT_NODE_ID); + } else { + String modulePath = apiData.getModulePath(); + if (!StringUtils.startsWith(modulePath, "/")) { + modulePath = "/" + modulePath; + apiData.setModulePath(modulePath); } - //不相同的数据需要覆盖 所以这里记录id就可以 - if (!isSame) { - importDTO.setId(apiDefinitionDTO.getId()); - if (StringUtils.equals(request.getPlatform(), ApiImportPlatform.Swagger3.name())) { - importDTO.getRequest().setChildren(dbRequest.getChildren()); - } - updateRequestData.add(importDTO); - logMap.put(apiDefinitionDTO.getId(), importDTO); + if (!modulePathMap.containsKey(modulePath)) { + apiDefinitionPreImportAnalysisResult.getInsertModuleList().addAll(TreeNodeParseUtils.getInsertNodeByPath(modulePathMap, modulePath)); } + apiData.setModuleId(modulePathMap.get(modulePath).getId()); + } + } + apiDefinitionPreImportAnalysisResult.getLogData().put(apiData.getId(), apiData); + apiDefinitionPreImportAnalysisResult.getInsertApiData().add(apiData); + //判断是否更新用例 + if (request.isSyncCase()) { + if (analysisResult.getApiIdAndTestCaseMap().containsKey(apiData.getId())) { + apiDefinitionPreImportAnalysisResult.getInsertApiCaseList().addAll(analysisResult.getApiIdAndTestCaseMap().get(apiData.getId())); + } + } + //判断是否更新Mock + if (request.isSyncMock()) { + if (analysisResult.getApiIdAndMockMap().containsKey(apiData.getId())) { + apiDefinitionPreImportAnalysisResult.getInsertApiMockList().addAll(analysisResult.getApiIdAndMockMap().get(apiData.getId())); } } } - //不存在的数据是肯定要插入的 TODO 这里需要判断是否需要创建模块 - if (CollectionUtils.isNotEmpty(differenceList)) { - addData = differenceList.stream().map(importDataMap::get).toList(); - } - apiDetailWithDataUpdate.setUpdateModuleData(updateModuleData); - apiDetailWithDataUpdate.setUpdateRequestData(updateRequestData); - apiDetailWithDataUpdate.setAddModuleData(addData); - apiDetailWithDataUpdate.setLogData(logMap); } - private void checkApiDataOnly(ImportRequest request, - List importData, - List apiLists, - ApiDetailWithData apiDetailWithData) { - //判断是否是同一接口 需要返回的数据 需要insert的 update的 - switch (request.getUniquelyIdentifies()) { - case "Method & Path" -> methodAndPath(importData, apiLists, apiDetailWithData); - default -> { + // 已有数据处理 + private void existenceDataAnalysis(ApiDefinitionPreImportAnalysisResult apiDefinitionPreImportAnalysisResult, ImportRequest request, Map modulePathMap, ApiImportDataAnalysisResult analysisResult) { + //不选择覆盖接口或者数据为空:终止操作 + if (CollectionUtils.isEmpty(analysisResult.getExistenceApiList()) || !request.isCoverData()) { + return; + } + List existenceApiList = analysisResult.getExistenceApiList(); + List existenceApiIdList = new ArrayList<>(); + existenceApiList.forEach(item -> existenceApiIdList.add(item.getExistenceApiDefinition().getId())); + Map existenceApiDefinitionBlobMap = this.selectApiDefinitionBlobIdMap(existenceApiIdList); + Map> existenceApiTestCaseMap = this.selectApiTestCaseIdMap(existenceApiIdList); + Map> existenceApiMockMap = this.selectApiMockIdMap(existenceApiIdList); + + for (ExistenceApiDefinitionDetail existenceApiDefinitionDetail : existenceApiList) { + ApiDefinitionDetail importApi = existenceApiDefinitionDetail.getImportApiDefinition(); + ApiDefinitionDetail existenceApi = existenceApiDefinitionDetail.getExistenceApiDefinition(); + + boolean isSameRequest = false; + ApiDefinitionBlob apiDefinitionBlob = existenceApiDefinitionBlobMap.get(existenceApi.getId()); + MsHTTPElement existenceMsHTTPElement = null; + if (apiDefinitionBlob != null) { + existenceMsHTTPElement = ApiDataUtils.parseObject(new String(apiDefinitionBlob.getRequest()), MsHTTPElement.class); + //判断参数是否一样 参数类型有 请求头 请求参数 请求体 + isSameRequest = dataIsSame(existenceMsHTTPElement, (MsHTTPElement) importApi.getRequest()); + } + + String importApiId = importApi.getId(); + importApi.setId(existenceApi.getId()); + if (request.isCoverModule()) { + // 未指定导入模块: 接口有模块,就放在那个模块下。 接口没模块就放在未规划模块内 + String modulePath = importApi.getModulePath(); + if (modulePathMap.containsKey(modulePath)) { + importApi.setModuleId(modulePathMap.get(modulePath).getId()); + } + boolean isSameModule = StringUtils.equals(importApi.getModuleId(), existenceApi.getModuleId()); + /* + 开启模块覆盖并覆盖接口,此时有4种情况: + */ + if (isSameRequest && isSameModule) { + //接口请求一样,模块一样: 不处理 + continue; + } + + if (!isSameRequest && isSameModule) { + //接口请求不一样,模块一样:更新接口的非模块信息 + this.updateApiDefinitionRequest(importApi, existenceMsHTTPElement, request.getPlatform()); + apiDefinitionPreImportAnalysisResult.getUpdateApiData().add(importApi); + } else if (isSameRequest) { + //接口请求一样,模块不一样:只更新接口模块信息 + importApi.setModuleId(existenceApi.getModuleId()); + this.updateApiDefinitionModule(importApi, modulePathMap, request.getModuleId(), apiDefinitionPreImportAnalysisResult); + apiDefinitionPreImportAnalysisResult.getUpdateModuleApiList().add(importApi); + } else { + //接口请求不一样,模块不一样:更新接口所有信息 + this.updateApiDefinitionRequest(importApi, existenceMsHTTPElement, request.getPlatform()); + this.updateApiDefinitionModule(importApi, modulePathMap, request.getModuleId(), apiDefinitionPreImportAnalysisResult); + apiDefinitionPreImportAnalysisResult.getUpdateApiData().add(importApi); + } + apiDefinitionPreImportAnalysisResult.getLogData().put(importApi.getId(), importApi); + + + } else { + if (!isSameRequest) { + //覆盖接口、不覆盖模块、 接口请求不一样,要更新接口的非模块信息;接口请求一样不处理, + this.updateApiDefinitionRequest(importApi, existenceMsHTTPElement, request.getPlatform()); + apiDefinitionPreImportAnalysisResult.getLogData().put(importApi.getId(), importApi); + apiDefinitionPreImportAnalysisResult.getUpdateApiData().add(importApi); + } + } + //是否同步用例 + if (request.isSyncCase()) { + boolean hasSyncCase = this.existenceApiTestCasePreparation(apiDefinitionPreImportAnalysisResult, + analysisResult.getApiIdAndTestCaseMap().get(importApiId), + importApi.getId(), + existenceApiTestCaseMap.get(importApi.getId())); + if (hasSyncCase && !apiDefinitionPreImportAnalysisResult.getLogData().containsKey(importApi.getId())) { + apiDefinitionPreImportAnalysisResult.getLogData().put(importApi.getId(), importApi); + } + } + //是否同步Mock + if (request.isSyncMock()) { + boolean hasSyncCase = this.existenceApiMockPreparation(apiDefinitionPreImportAnalysisResult, + analysisResult.getApiIdAndMockMap().get(importApiId), + importApi.getId(), + existenceApiMockMap.get(importApi.getId())); + if (hasSyncCase && !apiDefinitionPreImportAnalysisResult.getLogData().containsKey(importApi.getId())) { + apiDefinitionPreImportAnalysisResult.getLogData().put(importApi.getId(), importApi); + } } } } /** - * 判断数据唯一性 通过method和path判断 有重复的数据 需要覆盖 + * 覆盖接口的选项下,并且导入接口模块和已有接口模块不一致时,更新接口模块规则如下: + * 1.导入时指定了导入模块: + * a).导入的接口没有模块,就放在导入指定模块下 + * b).导入的接口有模块,在导入指定模块下select-or-create模块 + * c).导入时指定的是未规划模块,则所有的接口都放在未规划模块下 + * 2.导入时未指定模块 + * a).导入的接口没有模块,放在未规划模块下。 + * b).导入的接口有模块,根据导入接口的模块路径,从根目录select-or-create模块 + * + * @param importApi 要导入的api + * @param modulePathMap 已有的模块路径map + * @param importModuleId 导入指定的模块 + * @param apiDefinitionPreImportAnalysisResult 如果有需要创建的模块,要存储在result中 */ - public void methodAndPath(List importData, - List lists, - ApiDetailWithData apiDetailWithData) { + private void updateApiDefinitionModule(ApiDefinitionDetail importApi, Map modulePathMap, String importModuleId, ApiDefinitionPreImportAnalysisResult apiDefinitionPreImportAnalysisResult) { + if (StringUtils.equalsIgnoreCase(importModuleId, ModuleConstants.DEFAULT_NODE_ID)) { + importApi.setModuleId(ModuleConstants.DEFAULT_NODE_ID); + return; + } - Map apiDateMap = lists.stream().collect(Collectors.toMap(t -> t.getMethod() + t.getPath(), t -> t, (oldValue, newValue) -> newValue)); - Map importDataMap = importData.stream().collect(Collectors.toMap(t -> t.getMethod() + t.getPath(), t -> t, (oldValue, newValue) -> newValue)); - //判断是否重复 - List orgList = apiDateMap.keySet().stream().toList(); - List importList = importDataMap.keySet().stream().toList(); - //取交集数据 - List sameList = importList.stream().filter(orgList::contains).toList(); - // 不同接口的数据 - List differenceList = importList.stream().filter(t -> !orgList.contains(t)).toList(); - apiDetailWithData.setSameList(sameList); - apiDetailWithData.setDifferenceList(differenceList); - apiDetailWithData.setApiDateMap(apiDateMap); - apiDetailWithData.setImportDataMap(importDataMap); + if (StringUtils.isNotBlank(importApi.getModulePath())) { + // 只要导入的接口有模块,就要通过1b 或者 2b 来进行判断 + BaseTreeNode selectTreeNode = null; + if (StringUtils.isNotBlank(importModuleId)) { + selectTreeNode = modulePathMap.values().stream().filter(t -> StringUtils.equals(t.getId(), importModuleId)).findFirst().orElse(null); + } + String selectModulePath = selectTreeNode == null ? StringUtils.EMPTY : selectTreeNode.getPath(); + if (!StringUtils.startsWith(importApi.getModulePath(), "/")) { + importApi.setModulePath("/" + importApi.getModulePath()); + } + String fullPath = TreeNodeParseUtils.genFullModulePath(selectModulePath, importApi.getModulePath()); + if (!modulePathMap.containsKey(fullPath)) { + apiDefinitionPreImportAnalysisResult.getInsertModuleList().addAll(TreeNodeParseUtils.getInsertNodeByPath(modulePathMap, fullPath)); + } + importApi.setModuleId(modulePathMap.get(fullPath).getId()); + } else { + //导入的接口没模块,就要放在指定的导入模块 或者 根目录 下 + importApi.setModuleId(StringUtils.isBlank(importModuleId) ? ModuleConstants.DEFAULT_NODE_ID : importModuleId); + } + } + + private void updateApiDefinitionRequest(ApiDefinitionDetail importApi, MsHTTPElement existenceMsHTTPElement, String platform) { + if (StringUtils.equals(platform, ApiImportPlatform.Swagger3.name()) && existenceMsHTTPElement != null) { + //swagger如果接口已存在,并且要覆盖, 那么是不能覆盖原来接口的前后置数据的(因为swagger文件里没有) + importApi.getRequest().setChildren(existenceMsHTTPElement.getChildren()); + } + } + + public Map selectApiDefinitionBlobIdMap(List apiDefinitionIds) { + ApiDefinitionBlobExample example = new ApiDefinitionBlobExample(); + example.createCriteria().andIdIn(apiDefinitionIds); + List apiDefinitionBlobs = apiDefinitionBlobMapper.selectByExampleWithBLOBs(example); + return apiDefinitionBlobs.stream().collect(Collectors.toMap(ApiDefinitionBlob::getId, t -> t)); + + } + + public Map> selectApiTestCaseIdMap(List apiDefinitionIds) { + ApiTestCaseExample example = new ApiTestCaseExample(); + example.createCriteria().andApiDefinitionIdIn(apiDefinitionIds); + List apiTestCaseList = apiTestCaseMapper.selectByExample(example); + return apiTestCaseList.stream().collect(Collectors.groupingBy(ApiTestCase::getApiDefinitionId)); + } + + public Map> selectApiMockIdMap(List apiDefinitionIds) { + ApiDefinitionMockExample example = new ApiDefinitionMockExample(); + example.createCriteria().andApiDefinitionIdIn(apiDefinitionIds); + List apiMockList = apiDefinitionMockMapper.selectByExample(example); + return apiMockList.stream().collect(Collectors.groupingBy(ApiDefinitionMock::getApiDefinitionId)); + } + + /** + * 已有接口的用例数据处理:通过用例名判断唯一性。名称存在便更新,名称不存在便新增 + * + * @param apiDefinitionPreImportAnalysisResult 导入数据预处理结果集 + * @param importApiCaseList 要导入的api用例数据 + * @param existenceApiId 已存在的apiId + * @param existenceApiTestCaseList 已存在的接口用例 + * @return 是否存在新增或更新的用例数据 + */ + private boolean existenceApiTestCasePreparation(ApiDefinitionPreImportAnalysisResult apiDefinitionPreImportAnalysisResult, List importApiCaseList, String existenceApiId, List existenceApiTestCaseList) { + if (CollectionUtils.isNotEmpty(importApiCaseList)) { + Map apiTestCaseNameMap = new HashMap<>(); + if (CollectionUtils.isNotEmpty(existenceApiTestCaseList)) { + apiTestCaseNameMap = existenceApiTestCaseList.stream().collect(Collectors.toMap(ApiTestCase::getName, t -> t)); + } + List insertList = new ArrayList<>(); + List updateList = new ArrayList<>(); + for (ApiTestCaseDTO apiTestCaseDTO : importApiCaseList) { + apiTestCaseDTO.setApiDefinitionId(existenceApiId); + // 通过名字判断唯一性。名称存在便更新,名称不存在便新增 + if (apiTestCaseNameMap.containsKey(apiTestCaseDTO.getName())) { + apiTestCaseDTO.setId(apiTestCaseNameMap.get(apiTestCaseDTO.getName()).getId()); + updateList.add(apiTestCaseDTO); + } else { + insertList.add(apiTestCaseDTO); + } + } + if (CollectionUtils.isNotEmpty(insertList) || CollectionUtils.isNotEmpty(updateList)) { + apiDefinitionPreImportAnalysisResult.getUpdateApiCaseList().addAll(updateList); + apiDefinitionPreImportAnalysisResult.getInsertApiCaseList().addAll(insertList); + return true; + } + } + return false; + } + + /** + * 已有接口的Mock数据处理:通过Mock名判断唯一性。名称存在便更新,名称不存在便新增 + * + * @param apiDefinitionPreImportAnalysisResult 导入数据预处理结果集 + * @param apiMockDTOList 要导入的api用例数据 + * @param existenceApiId 已存在的apiId + * @param existenceApiMockList 已存在的接口用例 + * @return 是否存在新增或更新的用例数据 + */ + private boolean existenceApiMockPreparation(ApiDefinitionPreImportAnalysisResult apiDefinitionPreImportAnalysisResult, List apiMockDTOList, String existenceApiId, List existenceApiMockList) { + if (CollectionUtils.isNotEmpty(apiMockDTOList)) { + Map apiMockNameMap = new HashMap<>(); + if (CollectionUtils.isNotEmpty(existenceApiMockList)) { + apiMockNameMap = existenceApiMockList.stream().collect(Collectors.toMap(ApiDefinitionMock::getName, t -> t)); + } + List insertList = new ArrayList<>(); + List updateList = new ArrayList<>(); + for (ApiDefinitionMockDTO apiMockDTO : apiMockDTOList) { + apiMockDTO.setApiDefinitionId(existenceApiId); + // 通过名字判断唯一性。名称存在便更新,名称不存在便新增 + if (apiMockNameMap.containsKey(apiMockDTO.getName())) { + apiMockDTO.setId(apiMockNameMap.get(apiMockDTO.getName()).getId()); + updateList.add(apiMockDTO); + } else { + insertList.add(apiMockDTO); + } + } + if (CollectionUtils.isNotEmpty(insertList) || CollectionUtils.isNotEmpty(updateList)) { + apiDefinitionPreImportAnalysisResult.getUpdateApiMockList().addAll(updateList); + apiDefinitionPreImportAnalysisResult.getInsertApiMockList().addAll(insertList); + return true; + } + } + return false; } public boolean dataIsSame(MsHTTPElement dbRequest, MsHTTPElement importRequest) { @@ -800,13 +943,6 @@ public class ApiDefinitionImportService { return CollectionUtils.isNotEmpty(differenceRest); } - private Boolean getFullCoverage(Boolean fullCoverage) { - if (fullCoverage == null) { - fullCoverage = false; - } - return fullCoverage; - } - /** * 构造树结构 但是这里需要module的path * @@ -846,6 +982,8 @@ public class ApiDefinitionImportService { baseTreeNodeList.add(node); } traverseList = notMatchedList; + + // ApiDefinitionModule module = apiDefinitionModuleMapper.selectByPrimaryKey("ABC"); } return baseTreeNodeList; } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java index b0adcc21ac..f48926fc4b 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java @@ -653,7 +653,7 @@ public class ApiDefinitionService extends MoveNodeService { return copyName; } - private void handleDeleteApiDefinition(List ids, boolean deleteAllVersion, String projectId, String userId, boolean isBatch) { + public void handleDeleteApiDefinition(List ids, boolean deleteAllVersion, String projectId, String userId, boolean isBatch) { if (deleteAllVersion) { //全部删除 进入回收站 List refIds = extApiDefinitionMapper.getRefIds(ids, false); @@ -842,7 +842,7 @@ public class ApiDefinitionService extends MoveNodeService { } } - private void handleTrashDelApiDefinition(List ids, String userId, String projectId, boolean isBatch) { + public void handleTrashDelApiDefinition(List ids, String userId, String projectId, boolean isBatch) { if (CollectionUtils.isNotEmpty(ids)) { SubListUtils.dealForSubList(ids, 2000, subList -> doTrashDel(subList, userId, projectId, isBatch)); } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/schedule/SwaggerUrlImportJob.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/schedule/SwaggerUrlImportJob.java index addb783d8c..0717b9bbc6 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/schedule/SwaggerUrlImportJob.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/schedule/SwaggerUrlImportJob.java @@ -34,7 +34,7 @@ public class SwaggerUrlImportJob extends BaseScheduleJob { request.setUserId(jobDataMap.getString("userId")); request.setType("SCHEDULE"); request.setResourceId(resourceId); - apiDefinitionImportService.apiTestImport(null, request, request.getProjectId()); + apiDefinitionImportService.apiDefinitionImport(null, request, request.getProjectId()); } public static JobKey getJobKey(String resourceId) { diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/utils/ApiDefinitionImportUtils.java b/backend/services/api-test/src/main/java/io/metersphere/api/utils/ApiDefinitionImportUtils.java new file mode 100644 index 0000000000..280dcbdde1 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/utils/ApiDefinitionImportUtils.java @@ -0,0 +1,51 @@ +package io.metersphere.api.utils; + +import io.metersphere.api.constants.ApiImportPlatform; +import io.metersphere.api.dto.request.ImportRequest; +import io.metersphere.project.domain.Project; +import io.metersphere.sdk.constants.HttpMethodConstants; +import io.metersphere.sdk.exception.MSException; +import io.metersphere.sdk.util.JSON; +import io.metersphere.sdk.util.Translator; +import io.metersphere.system.log.dto.LogDTO; + + +public class ApiDefinitionImportUtils { + private static final String FILE_JMX = "jmx"; + private static final String FILE_HAR = "har"; + private static final String FILE_JSON = "json"; + + public static void checkFileSuffixName(ImportRequest request, String suffixName) { + if (FILE_JMX.equalsIgnoreCase(suffixName)) { + if (!ApiImportPlatform.Jmeter.name().equalsIgnoreCase(request.getPlatform())) { + throw new MSException(Translator.get("file_format_does_not_meet_requirements")); + } + } + if (FILE_HAR.equalsIgnoreCase(suffixName)) { + if (!ApiImportPlatform.Har.name().equalsIgnoreCase(request.getPlatform())) { + throw new MSException(Translator.get("file_format_does_not_meet_requirements")); + } + } + if (FILE_JSON.equalsIgnoreCase(suffixName)) { + if (ApiImportPlatform.Har.name().equalsIgnoreCase(request.getPlatform()) || ApiImportPlatform.Jmeter.name().equalsIgnoreCase(request.getPlatform())) { + throw new MSException(Translator.get("file_format_does_not_meet_requirements")); + } + } + } + + public static LogDTO genImportLog(Project project, String dataId, String dataName, Object importData, String module, String operator, String operationType) { + LogDTO dto = new LogDTO( + project.getId(), + project.getOrganizationId(), + dataId, + operator, + operationType, + module, + dataName); + dto.setHistory(true); + dto.setPath("/api/definition/import"); + dto.setMethod(HttpMethodConstants.POST.name()); + dto.setOriginalValue(JSON.toJSONBytes(importData)); + return dto; + } +} diff --git a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java index 7d302e94c0..006fd90b58 100644 --- a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java +++ b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java @@ -9,6 +9,7 @@ import io.metersphere.api.domain.*; import io.metersphere.api.dto.ApiFile; import io.metersphere.api.dto.ReferenceRequest; import io.metersphere.api.dto.definition.*; +import io.metersphere.api.dto.export.MetersphereApiExportResponse; import io.metersphere.api.dto.request.ApiEditPosRequest; import io.metersphere.api.dto.request.ApiTransferRequest; import io.metersphere.api.dto.request.ImportRequest; @@ -17,20 +18,21 @@ import io.metersphere.api.dto.request.http.MsHeader; import io.metersphere.api.dto.schema.JsonSchemaItem; import io.metersphere.api.mapper.*; import io.metersphere.api.model.CheckLogModel; +import io.metersphere.api.parser.ImportParserFactory; import io.metersphere.api.service.ApiCommonService; +import io.metersphere.api.service.ApiDefinitionImportTestService; import io.metersphere.api.service.ApiFileResourceService; import io.metersphere.api.service.BaseFileManagementTestService; import io.metersphere.api.service.definition.ApiDefinitionService; import io.metersphere.api.service.definition.ApiTestCaseService; import io.metersphere.api.utils.ApiDataUtils; import io.metersphere.plugin.api.spi.AbstractMsTestElement; +import io.metersphere.project.domain.Project; import io.metersphere.project.dto.filemanagement.FileInfo; import io.metersphere.project.mapper.ExtBaseProjectVersionMapper; +import io.metersphere.project.mapper.ProjectMapper; import io.metersphere.project.service.FileAssociationService; -import io.metersphere.sdk.constants.ApplicationNumScope; -import io.metersphere.sdk.constants.DefaultRepositoryDir; -import io.metersphere.sdk.constants.PermissionConstants; -import io.metersphere.sdk.constants.SessionConstants; +import io.metersphere.sdk.constants.*; import io.metersphere.sdk.exception.MSException; import io.metersphere.sdk.file.FileCenter; import io.metersphere.sdk.file.FileRequest; @@ -40,17 +42,20 @@ import io.metersphere.system.controller.handler.ResultHolder; import io.metersphere.system.controller.handler.result.MsHttpResultCode; import io.metersphere.system.domain.OperationHistory; import io.metersphere.system.domain.OperationHistoryExample; +import io.metersphere.system.dto.AddProjectRequest; import io.metersphere.system.dto.request.OperationHistoryRequest; import io.metersphere.system.dto.request.OperationHistoryVersionRequest; import io.metersphere.system.dto.sdk.BaseCondition; +import io.metersphere.system.log.constants.OperationLogModule; import io.metersphere.system.log.constants.OperationLogType; import io.metersphere.system.mapper.OperationHistoryMapper; +import io.metersphere.system.service.CommonProjectService; import io.metersphere.system.service.UserLoginService; import io.metersphere.system.uid.IDGenerator; import io.metersphere.system.uid.NumGenerator; import io.metersphere.system.utils.Pager; import jakarta.annotation.Resource; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.junit.jupiter.api.*; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; @@ -171,6 +176,9 @@ public class ApiDefinitionControllerTests extends BaseTest { private ApiScenarioStepMapper apiScenarioStepMapper; @Resource private UserLoginService userLoginService; + @Resource + private ApiDefinitionImportTestService apiDefinitionImportTestService; + private static String fileMetadataId; private static String uploadFileId; @@ -1686,7 +1694,323 @@ public class ApiDefinitionControllerTests extends BaseTest { paramMap.add("request", JSON.toJSONString(request)); this.requestMultipartWithOkAndReturn(IMPORT, paramMap); + this.importTest(); + } + @Resource + private CommonProjectService commonProjectService; + @Resource + private ProjectMapper projectMapper; + @Resource + private ApiDefinitionMockMapper apiDefinitionMockMapper; + + private void importTest() throws Exception { + //测试ImportParserFactory不按规定获取会返回null + Assertions.assertNull(ImportParserFactory.getImportParser("test")); + // 创建用于导入的项目 + //测试计划专用项目 + AddProjectRequest initProject = new AddProjectRequest(); + initProject.setOrganizationId("100001"); + initProject.setName("接口测试导入专用项目"); + initProject.setDescription("建国创建的接口测试专用项目"); + initProject.setEnable(true); + initProject.setUserIds(List.of("admin")); + Project importProject = commonProjectService.add(initProject, "admin", "/organization-project/add", OperationLogModule.SETTING_ORGANIZATION_PROJECT); + ArrayList moduleList = new ArrayList<>(List.of("workstation", "testPlan", "bugManagement", "caseManagement", "apiTest", "uiTest", "loadTest")); + Project updateProject = new Project(); + updateProject.setId(importProject.getId()); + updateProject.setModuleSetting(JSON.toJSONString(moduleList)); + projectMapper.updateByPrimaryKeySelective(updateProject); + + initProject.setName("接口测试导出专用项目"); + Project exportProject = commonProjectService.add(initProject, "admin", "/organization-project/add", OperationLogModule.SETTING_ORGANIZATION_PROJECT); + updateProject.setId(exportProject.getId()); + projectMapper.updateByPrimaryKeySelective(updateProject); + + /* + + 导入测试。 不同类型的文件,要按照如下指定的文件类型,走同样的导入逻辑判断。确保数据的高可用和对代码的高覆盖 + 以下是对导入文件的要求: + file/import/{importType}/single: 1个接口,无用例。 + file/import/{importType}/simple: 4个接口((其中2个url重复,合法数据只有3条,并且都在同一个模块下)); + 2个路径重复的接口下都有2个用例。 (用于校验路径相同的接口下,用例要合并起来导入) (Metersphere的还要有15个Mock,其中有名字一样的) + file/import/{importType}/repeatFileDiffApi: 和simple一样路径的4个接口(其中2个路径重复,合法数据只有3条),但是参数不一样; + 每个接口下都有2个用例,一共4个。 simple中的4个用例相比,有1个用例名字一样、对应的接口路径也一样。剩下的用例名称全部一样。(用于校验相同路径的接口下、相同名称的用例处理方式) + file/import/{importType}/repeatFileDiffModule: 和repeatFileDiffApi一样的4个接口(其中2个路径重复,合法数据只有3条),参数也一样,但是所属模块不一样; + 没有用例。(用于校验覆盖模块时,接口的变更) + + 以下是导入操作: + + 导入不存在的接口 + · 不指定导入模块 导入 {importType}/simple, 同步导入用例。校验有新增的模块,下面一共有3个API。其中有个API包含4个case + · 指定导入模块 导入 {importType}/single,校验模块新增了1个并有api + 导入存在的接口 + · 不覆盖接口 导入 {importType}/repeatFileDiffApi,校验模块没有变化,api数量没有变化,case数量没有变化 + · 覆盖接口 + · 不覆盖模块 + 导入 {importType}/repeatFileDiffApi,不导入用例,校验模块没有变化,api更新时间变了,case数量没有变化 + 再导入 {importType}/repeatFileDiffApi,导入用例,校验模块没有变化,api更新时间没变,case数量增加,应该是4+3+3 -1(名称重复的) + · 覆盖模块 + 接口一样,模块不一样: 导入 {importType}/repeatFileDiffModule, (测试指定导入模块,测试一下会不会创建多个模块) 判断接口对应的模块有更新, api内容没更新; + 接口不一样,模块不一样: 重新导入{importType}/simple, (测试测试不指定导入模块,测试一下会不会回到原模块) 判断接口对应的模块有更新, api内容有更新 + 接口不一样,模块一样: 重新导入{importType}/repeatFileDiffApi, 判断接口对应的模块没更新, api内容有更新 + 接口一样,模块一样: 再导入{importType}/repeatFileDiffApi, 判断接口对应的模块没更新, api内容没更新 + */ + + //导入类型以及文件后缀 + Map importTypeAndSuffix = new LinkedHashMap<>(); + importTypeAndSuffix.put("metersphere", "json"); + importTypeAndSuffix.put("postman", "json"); + importTypeAndSuffix.put("har", "har"); + List importCaseType = Arrays.asList("postman", "metersphere"); + List importModulesType = Arrays.asList("postman", "metersphere"); + + ApiDefinitionModuleExample moduleExample = new ApiDefinitionModuleExample(); + moduleExample.createCriteria().andProjectIdEqualTo(importProject.getId()); + ApiTestCaseExample apiTestCaseExample = new ApiTestCaseExample(); + apiTestCaseExample.createCriteria().andProjectIdEqualTo(importProject.getId()); + + for (Map.Entry entry : importTypeAndSuffix.entrySet()) { + ImportRequest request = new ImportRequest(); + request.setProjectId(importProject.getId()); + request.setProtocol(ApiConstants.HTTP_PROTOCOL); + request.setUserId("admin"); + + List apiDefinitionModuleList = apiDefinitionModuleMapper.selectByExample(moduleExample); + List apiBlobList = apiDefinitionImportTestService.selectBlobByProjectId(importProject.getId()); + List apiTestCaseList = apiTestCaseMapper.selectByExample(apiTestCaseExample); + Assertions.assertEquals(apiDefinitionModuleList.size(), 0); + Assertions.assertEquals(apiBlobList.size(), 0); + Assertions.assertEquals(apiTestCaseList.size(), 0); + boolean checkTestCase = importCaseType.contains(entry.getKey()); + boolean checkModules = importModulesType.contains(entry.getKey()); + + String importType = entry.getKey(); + String fileSuffix = entry.getValue(); + request.setPlatform(importType); + request.setSyncCase(true); + FileInputStream inputStream = new FileInputStream(new File(Objects.requireNonNull(this.getClass().getClassLoader().getResource("file/import/" + importType + "/simple." + fileSuffix)).getPath())); + MockMultipartFile file = new MockMultipartFile("file", "simple." + fileSuffix, MediaType.APPLICATION_OCTET_STREAM_VALUE, inputStream); + MultiValueMap paramMap = new LinkedMultiValueMap<>(); + paramMap.add("request", JSON.toJSONString(request)); + paramMap.add("file", file); + this.requestMultipartWithOkAndReturn(IMPORT, paramMap); + request.setSyncCase(false); + apiDefinitionModuleList = apiDefinitionModuleMapper.selectByExample(moduleExample); + apiBlobList = apiDefinitionImportTestService.selectBlobByProjectId(importProject.getId()); + Assertions.assertEquals(apiDefinitionModuleList.size(), checkModules ? 1 : 0); + Assertions.assertEquals(apiBlobList.size(), 3); + if (checkTestCase) { + apiTestCaseList = apiTestCaseMapper.selectByExample(apiTestCaseExample); + Assertions.assertEquals(apiTestCaseList.size(), 4); + } + + if (StringUtils.equalsIgnoreCase(importType, "metersphere")) { + request.setSyncMock(true); + request.setCoverData(true); + List apiString = apiBlobList.stream().map(ApiDefinitionBlob::getId).toList(); + ApiDefinitionMockExample apiDefinitionMockExample = new ApiDefinitionMockExample(); + apiDefinitionMockExample.createCriteria().andApiDefinitionIdIn(apiString).andProjectIdEqualTo(importProject.getId()); + List mockList = apiDefinitionMockMapper.selectByExample(apiDefinitionMockExample); + Assertions.assertEquals(mockList.size(), 0); + paramMap = new LinkedMultiValueMap<>(); + paramMap.add("file", file); + paramMap.add("request", JSON.toJSONString(request)); + this.requestMultipartWithOkAndReturn(IMPORT, paramMap); + mockList = apiDefinitionMockMapper.selectByExample(apiDefinitionMockExample); + Assertions.assertEquals(mockList.size(), 15); + + this.requestMultipartWithOkAndReturn(IMPORT, paramMap); + mockList = apiDefinitionMockMapper.selectByExample(apiDefinitionMockExample); + Assertions.assertEquals(mockList.size(), 15); + request.setSyncMock(false); + request.setCoverData(false); + } + + if (CollectionUtils.isEmpty(apiDefinitionModuleList)) { + request.setModuleId(ModuleConstants.DEFAULT_NODE_ID); + } else { + request.setModuleId(apiDefinitionModuleList.getFirst().getId()); + } + inputStream = new FileInputStream(new File(Objects.requireNonNull(this.getClass().getClassLoader().getResource("file/import/" + importType + "/single." + fileSuffix)).getPath())); + file = new MockMultipartFile("file", "single." + fileSuffix, MediaType.APPLICATION_OCTET_STREAM_VALUE, inputStream); + paramMap = new LinkedMultiValueMap<>(); + paramMap.add("request", JSON.toJSONString(request)); + paramMap.add("file", file); + this.requestMultipartWithOkAndReturn(IMPORT, paramMap); + request.setModuleId(null); + apiDefinitionModuleList = apiDefinitionModuleMapper.selectByExample(moduleExample); + apiBlobList = apiDefinitionImportTestService.selectBlobByProjectId(importProject.getId()); + Assertions.assertEquals(apiDefinitionModuleList.size(), checkModules ? 1 : 0); + Assertions.assertEquals(apiBlobList.size(), 4); + if (checkTestCase) { + apiTestCaseList = apiTestCaseMapper.selectByExample(apiTestCaseExample); + Assertions.assertEquals(apiTestCaseList.size(), 4); + } + + if (StringUtils.equalsIgnoreCase(importType, "metersphere")) { + //恰逢ms格式的导入,可以顺便测试导出 + this.testExportAndImport(importProject.getId(), apiBlobList); + } + + + // · 不覆盖接口 导入 {importType}/repeatFileDiffApi,校验模块没有变化,api无变化,case数量没有变化 + inputStream = new FileInputStream(new File(Objects.requireNonNull(this.getClass().getClassLoader().getResource("file/import/" + importType + "/repeatFileDiffApi." + fileSuffix)).getPath())); + file = new MockMultipartFile("file", "repeatFileDiffApi." + fileSuffix, MediaType.APPLICATION_OCTET_STREAM_VALUE, inputStream); + paramMap = new LinkedMultiValueMap<>(); + paramMap.add("request", JSON.toJSONString(request)); + paramMap.add("file", file); + this.requestMultipartWithOkAndReturn(IMPORT, paramMap); + request.setModuleId(null); + apiDefinitionModuleList = apiDefinitionModuleMapper.selectByExample(moduleExample); + Assertions.assertEquals(apiDefinitionModuleList.size(), checkModules ? 1 : 0); + List newApiBlobList = apiDefinitionImportTestService.selectBlobByProjectId(importProject.getId()); + apiDefinitionImportTestService.compareApiBlobList(apiBlobList, newApiBlobList, 0); + apiBlobList = newApiBlobList; + if (checkTestCase) { + List newApiTestCaseList = apiTestCaseMapper.selectByExample(apiTestCaseExample); + apiDefinitionImportTestService.compareApiTestCaseList(apiTestCaseList, newApiTestCaseList, 0, 0); + apiTestCaseList = newApiTestCaseList; + } + + //· 覆盖接口 + request.setCoverData(true); + // · 不覆盖模块 + // 导入 {importType}/repeatFileDiffApi,不导入用例,校验模块没有变化,api有3个变了,case数量没有变化 + inputStream = new FileInputStream(new File(Objects.requireNonNull(this.getClass().getClassLoader().getResource("file/import/" + importType + "/repeatFileDiffApi." + fileSuffix)).getPath())); + file = new MockMultipartFile("file", "repeatFileDiffApi." + fileSuffix, MediaType.APPLICATION_OCTET_STREAM_VALUE, inputStream); + paramMap = new LinkedMultiValueMap<>(); + paramMap.add("request", JSON.toJSONString(request)); + paramMap.add("file", file); + this.requestMultipartWithOkAndReturn(IMPORT, paramMap); + apiDefinitionModuleList = apiDefinitionModuleMapper.selectByExample(moduleExample); + Assertions.assertEquals(apiDefinitionModuleList.size(), checkModules ? 1 : 0); + newApiBlobList = apiDefinitionImportTestService.selectBlobByProjectId(importProject.getId()); + apiDefinitionImportTestService.compareApiBlobList(apiBlobList, newApiBlobList, 3); + apiBlobList = newApiBlobList; + if (checkTestCase) { + List newApiTestCaseList = apiTestCaseMapper.selectByExample(apiTestCaseExample); + apiDefinitionImportTestService.compareApiTestCaseList(apiTestCaseList, newApiTestCaseList, 0, 0); + apiTestCaseList = newApiTestCaseList; + } + + // 再导入 {importType}/repeatFileDiffApi,导入用例,校验模块没有变化,api无更新,case数量增加,应该是4+3+3 -1(名称重复的)、 + request.setSyncCase(true); + inputStream = new FileInputStream(new File(Objects.requireNonNull(this.getClass().getClassLoader().getResource("file/import/" + importType + "/repeatFileDiffApi." + fileSuffix)).getPath())); + file = new MockMultipartFile("file", "repeatFileDiffApi." + fileSuffix, MediaType.APPLICATION_OCTET_STREAM_VALUE, inputStream); + paramMap = new LinkedMultiValueMap<>(); + paramMap.add("request", JSON.toJSONString(request)); + paramMap.add("file", file); + this.requestMultipartWithOkAndReturn(IMPORT, paramMap); + request.setSyncCase(false); + apiDefinitionModuleList = apiDefinitionModuleMapper.selectByExample(moduleExample); + Assertions.assertEquals(apiDefinitionModuleList.size(), checkModules ? 1 : 0); + newApiBlobList = apiDefinitionImportTestService.selectBlobByProjectId(importProject.getId()); + apiDefinitionImportTestService.compareApiBlobList(apiBlobList, newApiBlobList, 0); + apiBlobList = newApiBlobList; + if (checkTestCase) { + List newApiTestCaseList = apiTestCaseMapper.selectByExample(apiTestCaseExample); + apiDefinitionImportTestService.compareApiTestCaseList(apiTestCaseList, newApiTestCaseList, 1, 3); + apiTestCaseList = newApiTestCaseList; + } + + // · 覆盖模块 + request.setCoverModule(true); + List newApiDefinition = new ArrayList<>(); + List oldApiDefinition = new ArrayList<>(); + if (checkModules) { + // 以下只针对需要检查模块的导入文件方式。 部分比如har文件,由于导入接口没有模块数据,故不需要检查模块 + // 接口一样,模块不一样: 导入 {importType}/repeatFileDiffModule, (测试测试指定导入模块,测试一下会不会创建多个模块) 判断接口对应的模块有更新, api内容没更新; + inputStream = new FileInputStream(new File(Objects.requireNonNull(this.getClass().getClassLoader().getResource("file/import/" + importType + "/repeatFileDiffModule." + fileSuffix)).getPath())); + file = new MockMultipartFile("file", "repeatFileDiffModule." + fileSuffix, MediaType.APPLICATION_OCTET_STREAM_VALUE, inputStream); + paramMap = new LinkedMultiValueMap<>(); + paramMap.add("request", JSON.toJSONString(request)); + paramMap.add("file", file); + this.requestMultipartWithOkAndReturn(IMPORT, paramMap); + apiDefinitionModuleList = apiDefinitionModuleMapper.selectByExample(moduleExample); + Assertions.assertTrue(apiDefinitionModuleList.size() > 1); + newApiBlobList = apiDefinitionImportTestService.selectBlobByProjectId(importProject.getId()); + apiDefinitionImportTestService.compareApiBlobList(apiBlobList, newApiBlobList, 0); + apiBlobList = newApiBlobList; + if (checkTestCase) { + List newApiTestCaseList = apiTestCaseMapper.selectByExample(apiTestCaseExample); + apiDefinitionImportTestService.compareApiTestCaseList(apiTestCaseList, newApiTestCaseList, 0, 0); + } + + // 接口不一样,模块不一样: 重新导入{importType}/simple, (测试测试不指定导入模块,测试一下会不会回到原模块) 判断接口对应的模块有更新, api内容有更新 + oldApiDefinition = apiDefinitionImportTestService.selectApiDefinitionByProjectId(importProject.getId()); + inputStream = new FileInputStream(new File(Objects.requireNonNull(this.getClass().getClassLoader().getResource("file/import/" + importType + "/simple." + fileSuffix)).getPath())); + file = new MockMultipartFile("file", "simple." + fileSuffix, MediaType.APPLICATION_OCTET_STREAM_VALUE, inputStream); + paramMap = new LinkedMultiValueMap<>(); + paramMap.add("request", JSON.toJSONString(request)); + paramMap.add("file", file); + this.requestMultipartWithOkAndReturn(IMPORT, paramMap); + apiDefinitionModuleList = apiDefinitionModuleMapper.selectByExample(moduleExample); + Assertions.assertTrue(apiDefinitionModuleList.size() > 1); + newApiDefinition = apiDefinitionImportTestService.selectApiDefinitionByProjectId(importProject.getId()); + apiDefinitionImportTestService.checkApiModuleChange(oldApiDefinition, newApiDefinition, 3); + newApiBlobList = apiDefinitionImportTestService.selectBlobByProjectId(importProject.getId()); + apiDefinitionImportTestService.compareApiBlobList(apiBlobList, newApiBlobList, 3); + apiBlobList = newApiBlobList; + oldApiDefinition = newApiDefinition; + + // 接口不一样,模块一样: 重新导入{importType}/repeatFileDiffApi, 判断接口对应的模块没更新, api内容有更新 + inputStream = new FileInputStream(new File(Objects.requireNonNull(this.getClass().getClassLoader().getResource("file/import/" + importType + "/repeatFileDiffApi." + fileSuffix)).getPath())); + file = new MockMultipartFile("file", "repeatFileDiffApi." + fileSuffix, MediaType.APPLICATION_OCTET_STREAM_VALUE, inputStream); + paramMap = new LinkedMultiValueMap<>(); + paramMap.add("request", JSON.toJSONString(request)); + paramMap.add("file", file); + this.requestMultipartWithOkAndReturn(IMPORT, paramMap); + newApiDefinition = apiDefinitionImportTestService.selectApiDefinitionByProjectId(importProject.getId()); + apiDefinitionImportTestService.checkApiModuleChange(oldApiDefinition, newApiDefinition, 0); + newApiBlobList = apiDefinitionImportTestService.selectBlobByProjectId(importProject.getId()); + apiDefinitionImportTestService.compareApiBlobList(apiBlobList, newApiBlobList, 3); + apiBlobList = newApiBlobList; + } + + + // 接口一样,模块一样: 再导入{importType}/repeatFileDiffApi, 判断接口对应的模块没更新, api内容没更新 + oldApiDefinition = newApiDefinition; + inputStream = new FileInputStream(new File(Objects.requireNonNull(this.getClass().getClassLoader().getResource("file/import/" + importType + "/repeatFileDiffApi." + fileSuffix)).getPath())); + file = new MockMultipartFile("file", "repeatFileDiffApi." + fileSuffix, MediaType.APPLICATION_OCTET_STREAM_VALUE, inputStream); + paramMap = new LinkedMultiValueMap<>(); + paramMap.add("request", JSON.toJSONString(request)); + paramMap.add("file", file); + this.requestMultipartWithOkAndReturn(IMPORT, paramMap); + newApiDefinition = apiDefinitionImportTestService.selectApiDefinitionByProjectId(importProject.getId()); + apiDefinitionImportTestService.checkApiModuleChange(oldApiDefinition, newApiDefinition, 0); + newApiBlobList = apiDefinitionImportTestService.selectBlobByProjectId(importProject.getId()); + apiDefinitionImportTestService.compareApiBlobList(apiBlobList, newApiBlobList, 0); + + //删除本次导入的数据 + List apiIds = newApiDefinition.stream().map(ApiDefinition::getId).collect(Collectors.toList()); + apiDefinitionService.handleDeleteApiDefinition(apiIds, true, request.getProjectId(), "admin", true); + apiDefinitionService.handleTrashDelApiDefinition(apiIds, "admin", importProject.getId(), true); + newApiDefinition = apiDefinitionImportTestService.selectApiDefinitionByProjectId(importProject.getId()); + newApiBlobList = apiDefinitionImportTestService.selectBlobByProjectId(importProject.getId()); + List newApiTestCaseList = apiTestCaseMapper.selectByExample(apiTestCaseExample); + ApiDefinitionModuleExample deleteModuleExample = new ApiDefinitionModuleExample(); + deleteModuleExample.createCriteria().andProjectIdEqualTo(importProject.getId()); + apiDefinitionModuleMapper.deleteByExample(deleteModuleExample); + apiDefinitionModuleList = apiDefinitionModuleMapper.selectByExample(moduleExample); + Assertions.assertEquals(apiDefinitionModuleList.size(), 0); + Assertions.assertEquals(newApiDefinition.size(), 0); + Assertions.assertEquals(newApiBlobList.size(), 0); + Assertions.assertEquals(newApiTestCaseList.size(), 0); + } + } + + private void testExportAndImport(String exportProjectId, List exportApiBlobs) throws Exception { + ApiDefinitionBatchRequest exportRequest = new ApiDefinitionBatchRequest(); + exportRequest.setProjectId(exportProjectId); + exportRequest.setSelectAll(true); + exportRequest.setExportApiCase(true); + exportRequest.setExportApiMock(true); + MvcResult mvcResult = this.requestPostWithOkAndReturn(EXPORT + "metersphere", exportRequest); + String returnData = mvcResult.getResponse().getContentAsString(StandardCharsets.UTF_8); + ResultHolder resultHolder = JSON.parseObject(returnData, ResultHolder.class); + MetersphereApiExportResponse exportResponse = ApiDataUtils.parseObject(JSON.toJSONString(resultHolder.getData()), MetersphereApiExportResponse.class); + apiDefinitionImportTestService.compareApiExport(exportResponse, exportApiBlobs); } protected MvcResult requestMultipart(String url, MultiValueMap paramMap, ResultMatcher resultMatcher) throws Exception { diff --git a/backend/services/api-test/src/test/java/io/metersphere/api/service/ApiDefinitionImportTestService.java b/backend/services/api-test/src/test/java/io/metersphere/api/service/ApiDefinitionImportTestService.java new file mode 100644 index 0000000000..87091e7f84 --- /dev/null +++ b/backend/services/api-test/src/test/java/io/metersphere/api/service/ApiDefinitionImportTestService.java @@ -0,0 +1,116 @@ +package io.metersphere.api.service; + +import io.metersphere.api.domain.*; +import io.metersphere.api.dto.converter.ApiDefinitionExportDetail; +import io.metersphere.api.dto.export.MetersphereApiExportResponse; +import io.metersphere.api.dto.request.http.MsHTTPElement; +import io.metersphere.api.mapper.ApiDefinitionBlobMapper; +import io.metersphere.api.mapper.ApiDefinitionMapper; +import io.metersphere.api.service.definition.ApiDefinitionImportService; +import io.metersphere.api.utils.ApiDataUtils; +import jakarta.annotation.Resource; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.junit.jupiter.api.Assertions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; + +@Service +public class ApiDefinitionImportTestService extends ApiDefinitionImportService { + @Resource + private ApiDefinitionMapper apiDefinitionMapper; + @Resource + private ApiDefinitionBlobMapper apiDefinitionBlobMapper; + + public void compareApiBlobList(List apiDefinitionList, List newApiDefinitionList, int apiChangedCount) { + if (apiChangedCount == 0) { + Assertions.assertEquals(apiDefinitionList.size(), newApiDefinitionList.size()); + } + Map oldApiBlobMap = apiDefinitionList.stream().collect(Collectors.toMap(ApiDefinitionBlob::getId, Function.identity())); + Map newApiBlobMap = newApiDefinitionList.stream().collect(Collectors.toMap(ApiDefinitionBlob::getId, Function.identity())); + + int diffApiCount = 0; + for (Map.Entry entry : oldApiBlobMap.entrySet()) { + ApiDefinitionBlob oldBlob = entry.getValue(); + ApiDefinitionBlob newBlob = newApiBlobMap.get(entry.getKey()); + + boolean dataIsSame = dataIsSame(ApiDataUtils.parseObject(new String(oldBlob.getRequest()), MsHTTPElement.class), ApiDataUtils.parseObject(new String(newBlob.getRequest()), MsHTTPElement.class)); + if (!dataIsSame) { + diffApiCount++; + } + } + Assertions.assertEquals(apiChangedCount, diffApiCount); + } + + public void compareApiTestCaseList(List apiTestCaseList, List newApiTestCaseList, int apiTestCaseChangeCount, int apiTestCaseAddCount) { + Assertions.assertEquals(apiTestCaseList.size() + apiTestCaseAddCount, newApiTestCaseList.size()); + Map oldDataMap = apiTestCaseList.stream().collect(Collectors.toMap(ApiTestCase::getId, Function.identity())); + Map newDataMap = newApiTestCaseList.stream().collect(Collectors.toMap(ApiTestCase::getId, Function.identity())); + + int diffCaseCount = 0; + for (Map.Entry entry : oldDataMap.entrySet()) { + ApiTestCase oldCase = entry.getValue(); + ApiTestCase newCase = newDataMap.get(entry.getKey()); + if (!Objects.equals(oldCase.getUpdateTime(), newCase.getUpdateTime())) { + diffCaseCount++; + } + } + Assertions.assertEquals(apiTestCaseChangeCount, diffCaseCount); + } + + public List selectBlobByProjectId(String projectId) { + ApiDefinitionExample apiDefinitionExample = new ApiDefinitionExample(); + apiDefinitionExample.createCriteria().andProjectIdEqualTo(projectId); + List apiIdList = apiDefinitionMapper.selectByExample(apiDefinitionExample).stream().map(ApiDefinition::getId).toList(); + + if (CollectionUtils.isEmpty(apiIdList)) { + return new ArrayList<>(); + } else { + ApiDefinitionBlobExample example = new ApiDefinitionBlobExample(); + example.createCriteria().andIdIn(apiIdList); + return apiDefinitionBlobMapper.selectByExampleWithBLOBs(example); + } + } + + public List selectApiDefinitionByProjectId(String projectId) { + ApiDefinitionExample apiDefinitionExample = new ApiDefinitionExample(); + apiDefinitionExample.createCriteria().andProjectIdEqualTo(projectId); + return apiDefinitionMapper.selectByExample(apiDefinitionExample); + } + + public void checkApiModuleChange(List oldApiDefinition, List newApiDefinition, int moduleChangeCount) { + Map oldDataMap = oldApiDefinition.stream().collect(Collectors.toMap(ApiDefinition::getId, Function.identity())); + Map newDataMap = newApiDefinition.stream().collect(Collectors.toMap(ApiDefinition::getId, Function.identity())); + + int diffApiCount = 0; + for (Map.Entry entry : oldDataMap.entrySet()) { + ApiDefinition oldData = entry.getValue(); + ApiDefinition newData = newDataMap.get(entry.getKey()); + if (!StringUtils.equals(oldData.getModuleId(), newData.getModuleId())) { + diffApiCount++; + } + } + Assertions.assertEquals(moduleChangeCount, diffApiCount); + } + + public void compareApiExport(MetersphereApiExportResponse exportResponse, List exportApiBlobs) { + Assertions.assertEquals(exportResponse.getApiDefinitions().size(), exportApiBlobs.size()); + List compareList = new ArrayList<>(); + for (ApiDefinitionBlob blob : exportApiBlobs) { + for (ApiDefinitionExportDetail exportDetail : exportResponse.getApiDefinitions()) { + boolean dataIsSame = dataIsSame(ApiDataUtils.parseObject(new String(blob.getRequest()), MsHTTPElement.class), (MsHTTPElement) exportDetail.getRequest()); + if (dataIsSame) { + compareList.add(exportDetail); + break; + } + } + } + Assertions.assertEquals(exportResponse.getApiDefinitions().size(), compareList.size()); + } +} \ No newline at end of file diff --git a/backend/services/api-test/src/test/resources/file/import/har/repeatFileDiffApi.har b/backend/services/api-test/src/test/resources/file/import/har/repeatFileDiffApi.har new file mode 100644 index 0000000000..1f1371293d --- /dev/null +++ b/backend/services/api-test/src/test/resources/file/import/har/repeatFileDiffApi.har @@ -0,0 +1,2766 @@ +{ + "log": { + "version": "1.2", + "creator": { + "name": "WebInspector", + "version": "537.36" + }, + "pages": [], + "entries": [ + { + "_initiator": { + "type": "script", + "stack": { + "callFrames": [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 145648 + }, + { + "functionName": "xhr", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 143691 + }, + { + "functionName": "Qt", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 150609 + } + ], + "parent": { + "description": "Promise.then", + "callFrames": [ + { + "functionName": "_request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 153327 + }, + { + "functionName": "request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 151983 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 121631 + }, + { + "functionName": "V", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 361292 + }, + { + "functionName": "c", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 19924 + }, + { + "functionName": "search", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 16984 + }, + { + "functionName": "mounted", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 18346 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24950 + }, + { + "functionName": "zi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 33922 + }, + { + "functionName": "insert", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 37374 + }, + { + "functionName": "A", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 58002 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 59327 + }, + { + "functionName": "Pi.e._update", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 31510 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 32273 + }, + { + "functionName": "e.get", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 28492 + }, + { + "functionName": "e.run", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 29229 + }, + { + "functionName": "Qi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 34489 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26031 + }, + { + "functionName": "Yn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25426 + } + ], + "parent": { + "description": "Promise.then", + "callFrames": [ + { + "functionName": "Hn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25517 + }, + { + "functionName": "Qn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26096 + }, + { + "functionName": "ir", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 35002 + }, + { + "functionName": "e.update", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 29165 + }, + { + "functionName": "e.notify", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 6804 + }, + { + "functionName": "set", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 8662 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56623 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56594 + }, + { + "functionName": "et.updateRoute", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51463 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50046 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51328 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51259 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47670 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48404 + } + ], + "parent": { + "description": "Promise.then", + "callFrames": [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47847 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48039 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48015 + }, + { + "functionName": "Ke", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47965 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47474 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 400894 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "et.confirmTransition", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51194 + }, + { + "functionName": "et.transitionTo", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50012 + }, + { + "functionName": "t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 53641 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57086 + }, + { + "functionName": "_t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57049 + }, + { + "functionName": "f.Ay.push", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 389825 + }, + { + "functionName": "routeToItem", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110768 + }, + { + "functionName": "handleItemClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110374 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "Ai.e.$emit", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 30964 + }, + { + "functionName": "dispatch", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 620936 + }, + { + "functionName": "handleClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 120315 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "n", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 14734 + }, + { + "functionName": "Pa.o._wrapper", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 62419 + } + ] + } + } + } + } + }, + "_priority": "High", + "_resourceType": "xhr", + "cache": {}, + "connection": "1187519", + "request": { + "method": "POST", + "url": "http://172.16.10.66:8081/setting/quota/list/workspace/1/10", + "httpVersion": "HTTP/1.1", + "headers": [ + { + "name": "Accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "Accept-Encoding", + "value": "gzip, deflate" + }, + { + "name": "Accept-Language", + "value": "zh-CN" + }, + { + "name": "CSRF-TOKEN", + "value": "442WhMRQfh9N2uVKgj6YOWgY6JmGJk+MkyKq0N6UMrxgeyaiiAtqTAPNjI4bu6miUKuGeevt23GOhSuvD8agAXaVgK/j9LbBH0aqfaXc2KU=" + }, + { + "name": "Connection", + "value": "keep-alive" + }, + { + "name": "Content-Length", + "value": "2" + }, + { + "name": "Content-Type", + "value": "application/json" + }, + { + "name": "Host", + "value": "172.16.10.66:8081" + }, + { + "name": "Origin", + "value": "http://172.16.10.66:8081" + }, + { + "name": "PROJECT", + "value": "05a5c1ea-d1e2-4645-956f-6300d4becf00" + }, + { + "name": "Referer", + "value": "http://172.16.10.66:8081/" + }, + { + "name": "User-Agent", + "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36" + }, + { + "name": "WORKSPACE", + "value": "048b143c-e071-424f-b5fe-3ca89fb93c13" + }, + { + "name": "X-AUTH-TOKEN", + "value": "616e19c0-3b10-4391-81a9-401e6f6f1b34" + } + ], + "queryString": [], + "cookies": [], + "headersSize": 720, + "bodySize": 2, + "postData": { + "mimeType": "application/json", + "text": "{\"name\":\"abcdef\"}" + } + }, + "response": { + "status": 200, + "statusText": "OK", + "httpVersion": "HTTP/1.1", + "headers": [ + { + "name": "Content-Encoding", + "value": "gzip" + }, + { + "name": "Content-Type", + "value": "application/json" + }, + { + "name": "Date", + "value": "Thu, 08 Aug 2024 08:05:45 GMT" + }, + { + "name": "Vary", + "value": "Origin" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Method" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Headers" + }, + { + "name": "Vary", + "value": "Accept-Encoding" + }, + { + "name": "transfer-encoding", + "value": "chunked" + } + ], + "cookies": [], + "content": { + "size": 4081, + "mimeType": "application/json", + "compression": 3103, + "text": "{\"success\":true,\"message\":null,\"data\":{\"listObject\":[{\"id\":\"87c67f3c-cd5d-4b88-b7db-bf95f6e8553b\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"c239e34f-faf3-43d1-8294-4584731c199e\",\"useDefault\":true,\"updateTime\":1721784547632,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_ut4mjnvx\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"121bbe7d-bc40-4a9b-923f-d1cfa41003cd\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"d2658c95-7d7a-46f9-8928-e77e7f9d2b4e\",\"useDefault\":true,\"updateTime\":1721784542058,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_guPvyG90\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"2617aa3e-b887-49d8-8c73-e12aca1f8a82\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"5ecb39c8-7789-4882-b73d-e9613f310aa7\",\"useDefault\":true,\"updateTime\":1721784531076,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_xan83ZB7\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"8a9a28dd-5adf-4543-9bdc-af28907aba26\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"2729e83e-984a-4a50-ae9c-85b5f81346b0\",\"useDefault\":true,\"updateTime\":1721784526531,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_zfFEit0M\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"3cc53e8c-990c-4ffb-aa8c-8a9302969012\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"c6b164bb-3966-4c10-8ac1-2f451cab339f\",\"useDefault\":true,\"updateTime\":1721784517974,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_P0qyCMeh\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"bf75cfac-3f7e-4587-a5bc-de1014825597\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"97679d16-4f30-4df5-be45-f91379aecf19\",\"useDefault\":true,\"updateTime\":1721783923519,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_tQAI6tc4\",\"projectName\":null,\"projectUsed\":2},{\"id\":\"5510344a-d2cc-4587-a55e-2917f6514f7d\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"431e813d-5de5-4c1d-affe-34f8f15a1108\",\"useDefault\":true,\"updateTime\":1721783087058,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_2pA85Gpv\",\"projectName\":null,\"projectUsed\":1},{\"id\":\"46872b1b-372b-4de7-8f0b-53d065893f08\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"b1da8acc-cb55-450c-9189-a36e143cfa57\",\"useDefault\":true,\"updateTime\":1720175342992,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"guoxiaoyong\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"25d6051b-116a-4561-93b4-6bcd20b4803d\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"7caa64ef-1f1b-400c-964c-f52587856ccb\",\"useDefault\":true,\"updateTime\":1720075574958,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":0.17,\"moduleSetting\":null,\"workspaceName\":\"7.4工作空间-yc\",\"projectName\":null,\"projectUsed\":1},{\"id\":\"2f996458-fc84-42e7-813b-d802603acb2a\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"25140054-8520-4bc7-a231-76366f56cf78\",\"useDefault\":true,\"updateTime\":1719363182724,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_nBt3I17E\",\"projectName\":null,\"projectUsed\":0}],\"itemCount\":67,\"pageCount\":7}}" + }, + "redirectURL": "", + "headersSize": 252, + "bodySize": 978, + "_transferSize": 1230, + "_error": null, + "_fetchedViaServiceWorker": false + }, + "serverIPAddress": "172.16.10.66", + "startedDateTime": "2024-08-08T08:06:14.400Z", + "time": 154.3320000055246, + "timings": { + "blocked": 0.6249999846555292, + "dns": -1, + "ssl": -1, + "connect": -1, + "send": 0.05700000000000002, + "wait": 153.4819999930989, + "receive": 0.16800002777017653, + "_blocked_queueing": 0.44899998465552926, + "_workerStart": -1, + "_workerReady": -1, + "_workerFetchStart": -1, + "_workerRespondWithSettled": -1 + } + }, + { + "_initiator": { + "type": "script", + "stack": { + "callFrames": [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 145648 + }, + { + "functionName": "xhr", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 143691 + }, + { + "functionName": "Qt", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 150609 + } + ], + "parent": { + "description": "Promise.then", + "callFrames": [ + { + "functionName": "_request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 153327 + }, + { + "functionName": "request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 151983 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 121631 + }, + { + "functionName": "T", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 361243 + }, + { + "functionName": "i", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 19733 + }, + { + "functionName": "getResourcePool", + "scriptId": "49", + "url": "http://172.16.10.66:8081/js/setting-3617.3c6437cc.js", + "lineNumber": 0, + "columnNumber": 2049 + }, + { + "functionName": "mounted", + "scriptId": "49", + "url": "http://172.16.10.66:8081/js/setting-3617.3c6437cc.js", + "lineNumber": 0, + "columnNumber": 2522 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24950 + }, + { + "functionName": "zi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 33922 + }, + { + "functionName": "insert", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 37374 + }, + { + "functionName": "A", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 58002 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 59327 + }, + { + "functionName": "Pi.e._update", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 31510 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 32273 + }, + { + "functionName": "e.get", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 28492 + }, + { + "functionName": "e.run", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 29229 + }, + { + "functionName": "Qi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 34489 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26031 + }, + { + "functionName": "Yn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25426 + } + ], + "parent": { + "description": "Promise.then", + "callFrames": [ + { + "functionName": "Hn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25517 + }, + { + "functionName": "Qn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26096 + }, + { + "functionName": "ir", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 35002 + }, + { + "functionName": "e.update", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 29165 + }, + { + "functionName": "e.notify", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 6804 + }, + { + "functionName": "set", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 8662 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56623 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56594 + }, + { + "functionName": "et.updateRoute", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51463 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50046 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51328 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51259 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47670 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48404 + } + ], + "parent": { + "description": "Promise.then", + "callFrames": [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47847 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48039 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48015 + }, + { + "functionName": "Ke", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47965 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47474 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 400894 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "et.confirmTransition", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51194 + }, + { + "functionName": "et.transitionTo", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50012 + }, + { + "functionName": "t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 53641 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57086 + }, + { + "functionName": "_t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57049 + }, + { + "functionName": "f.Ay.push", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 389825 + }, + { + "functionName": "routeToItem", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110768 + }, + { + "functionName": "handleItemClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110374 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "Ai.e.$emit", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 30964 + }, + { + "functionName": "dispatch", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 620936 + }, + { + "functionName": "handleClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 120315 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "n", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 14734 + }, + { + "functionName": "Pa.o._wrapper", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 62419 + } + ] + } + } + } + } + }, + "_priority": "High", + "_resourceType": "xhr", + "cache": {}, + "connection": "1187656", + "request": { + "method": "GET", + "url": "http://172.16.10.66:8081/setting/testresourcepool/list/all/valid", + "httpVersion": "HTTP/1.1", + "headers": [ + { + "name": "Accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "Accept-Encoding", + "value": "gzip, deflate" + }, + { + "name": "Accept-Language", + "value": "zh-CN" + }, + { + "name": "CSRF-TOKEN", + "value": "442WhMRQfh9N2uVKgj6YOWgY6JmGJk+MkyKq0N6UMrxgeyaiiAtqTAPNjI4bu6miUKuGeevt23GOhSuvD8agAXaVgK/j9LbBH0aqfaXc2KU=" + }, + { + "name": "Connection", + "value": "keep-alive" + }, + { + "name": "Host", + "value": "172.16.10.66:8081" + }, + { + "name": "PROJECT", + "value": "05a5c1ea-d1e2-4645-956f-6300d4becf00" + }, + { + "name": "Referer", + "value": "http://172.16.10.66:8081/" + }, + { + "name": "User-Agent", + "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36" + }, + { + "name": "WORKSPACE", + "value": "048b143c-e071-424f-b5fe-3ca89fb93c13" + }, + { + "name": "X-AUTH-TOKEN", + "value": "616e19c0-3b10-4391-81a9-401e6f6f1b34" + } + ], + "queryString": [ + { + "name": "param1", + "value": "param2" + } + ], + "cookies": [], + "headersSize": 640, + "bodySize": 0 + }, + "response": { + "status": 200, + "statusText": "OK", + "httpVersion": "HTTP/1.1", + "headers": [ + { + "name": "Content-Encoding", + "value": "gzip" + }, + { + "name": "Content-Type", + "value": "application/json" + }, + { + "name": "Date", + "value": "Thu, 08 Aug 2024 08:05:45 GMT" + }, + { + "name": "Vary", + "value": "Origin" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Method" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Headers" + }, + { + "name": "Vary", + "value": "Accept-Encoding" + }, + { + "name": "transfer-encoding", + "value": "chunked" + } + ], + "cookies": [], + "content": { + "size": 10961, + "mimeType": "application/json", + "compression": 8105, + "text": "{\"success\":true,\"message\":null,\"data\":[{\"id\":\"8c17bdc2-1817-11eb-92cf-0242ac120004\",\"name\":\"LOCAL\",\"type\":\"NODE\",\"description\":\"系统默认创建的本地资源池\",\"status\":\"VALID\",\"createTime\":1603777497000,\"updateTime\":1721965035953,\"image\":\"registry.cn-qingdao.aliyuncs.com/metersphere/jmeter-master:5.5-ms12-jdk17\",\"heap\":\"-Xms4g -Xmx4g -XX:MaxMetaspaceSize=2048m\",\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"8c17fc37-1817-11eb-92cf-0242ac120004\",\"testResourcePoolId\":\"8c17bdc2-1817-11eb-92cf-0242ac120004\",\"status\":\"VALID\",\"createTime\":1721965035956,\"updateTime\":1721965035956,\"configuration\":\"{\\\"port\\\":8082,\\\"maxConcurrency\\\":5000,\\\"ip\\\":\\\"ms-node-controller\\\",\\\"id\\\":\\\"8c17fc37-1817-11eb-92cf-0242ac120004\\\",\\\"monitorPort\\\":9100,\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\",\\\"enable\\\":true}\"}]},{\"id\":\"bafa05bb-d4f6-4eaf-a8de-0d895b80ed94\",\"name\":\"副老师的资源池\",\"type\":\"NODE\",\"description\":null,\"status\":\"VALID\",\"createTime\":1721730696108,\"updateTime\":1721730709537,\"image\":\"registry.cn-qingdao.aliyuncs.com/metersphere/jmeter-master:5.5-ms12-jdk17\",\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"5d45cbd9-78aa-4488-b619-a1d3d5057cdd\",\"testResourcePoolId\":\"bafa05bb-d4f6-4eaf-a8de-0d895b80ed94\",\"status\":\"VALID\",\"createTime\":1721730709543,\"updateTime\":1721730709543,\"configuration\":\"{\\\"ip\\\":\\\"172.16.200.15\\\",\\\"port\\\":8082,\\\"monitorPort\\\":9100,\\\"maxConcurrency\\\":100,\\\"id\\\":\\\"5d45cbd9-78aa-4488-b619-a1d3d5057cdd\\\",\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\"}\"}]},{\"id\":\"28947e4b-b2b5-4379-90d2-a6cf670b506e\",\"name\":\"66资源池\",\"type\":\"NODE\",\"description\":null,\"status\":\"VALID\",\"createTime\":1689760838776,\"updateTime\":1721369328900,\"image\":\"registry.cn-qingdao.aliyuncs.com/metersphere/jmeter-master:5.5-ms12-jdk17\",\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"9ffc1be4-bb29-4114-8648-0376a171f916\",\"testResourcePoolId\":\"28947e4b-b2b5-4379-90d2-a6cf670b506e\",\"status\":\"VALID\",\"createTime\":1721369328936,\"updateTime\":1721369328936,\"configuration\":\"{\\\"ip\\\":\\\"172.16.10.66\\\",\\\"port\\\":8082,\\\"monitorPort\\\":435,\\\"maxConcurrency\\\":5000,\\\"id\\\":\\\"9ffc1be4-bb29-4114-8648-0376a171f916\\\",\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\"}\"}]},{\"id\":\"132c515d-5d39-4c21-af1e-40c6b748d366\",\"name\":\"K8s-200\",\"type\":\"K8S\",\"description\":null,\"status\":\"VALID\",\"createTime\":1690536571532,\"updateTime\":1720259779615,\"image\":\"registry.cn-qingdao.aliyuncs.com/metersphere/jmeter-master:5.5-ms9-jdk17\",\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"11cdfe06-0f34-4589-982d-04f6462f9e83\",\"testResourcePoolId\":\"132c515d-5d39-4c21-af1e-40c6b748d366\",\"status\":\"VALID\",\"createTime\":1720259779780,\"updateTime\":1720259779780,\"configuration\":\"{\\\"masterUrl\\\":\\\"https://172.16.10.200:6443\\\",\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsImtpZCI6IldrcGdYOGZMX2xCeFVtTTVEYnViTUtweGNIeHR5RGtQOWRtRWpWbjNrMlEifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrby1hZG1pbi10b2tlbi0yNGZ0dyIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJrby1hZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjczMWEyNzhiLTY3NDYtNDU2MC1iYjJmLTVhNzEyNzJmODVmZCIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlLXN5c3RlbTprby1hZG1pbiJ9.dpgXt9h51WnOQ9UjOuuhsNyCDrDFCFE6lk7w86VMP-OxLtJYbuYjrhxOUDrfRuz7SYRsjfWLKF-LaX0b_Hw7fccWKQoOZUJQTmw93TP1MpUqbhFlyw8anTsV_B2miPuWlZvj5IsU423X14kAngMsXPzJ_xItr1m3bcbbDFsavWlQTkhMi6b5pvhdio_bSomz34oe6m3KaZdLsD2N9gJuLkCZa5jG0aL1RgbLHVxdc85UqMMMZ-9puqozlRTlH1-DnHAitbIUUV6OIqU1wcKYzRcJsJ5qWnTne70B-2eygNMm17rQjyrIUQwNwdc5ucnYXCfJntnvZuZKLD41Sj7uUw\\\",\\\"namespace\\\":\\\"youly\\\",\\\"podThreadLimit\\\":5000,\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\",\\\"maxConcurrency\\\":100,\\\"enable\\\":false,\\\"id\\\":\\\"11cdfe06-0f34-4589-982d-04f6462f9e83\\\",\\\"monitorPort\\\":\\\"9100\\\",\\\"jobTemplate\\\":\\\"apiVersion: batch/v1\\\\nkind: Job\\\\nmetadata:\\\\n labels:\\\\n test-id: ${TEST_ID}\\\\n name: ${JOB_NAME}\\\\nspec:\\\\n parallelism: 1\\\\n template:\\\\n metadata:\\\\n labels:\\\\n test-id: ${TEST_ID}\\\\n spec:\\\\n containers:\\\\n - command:\\\\n - sh\\\\n - -c\\\\n - /run-test.sh\\\\n env:\\\\n - name: START_TIME\\\\n value: \\\\\\\"${START_TIME}\\\\\\\"\\\\n - name: GRANULARITY\\\\n value: \\\\\\\"${GRANULARITY}\\\\\\\"\\\\n - name: JMETER_REPORTS_TOPIC\\\\n value: ${JMETER_REPORTS_TOPIC}\\\\n - name: METERSPHERE_URL\\\\n value: ${METERSPHERE_URL}\\\\n - name: RESOURCE_ID\\\\n value: ${RESOURCE_ID}\\\\n - name: BACKEND_LISTENER\\\\n value: \\\\\\\"${BACKEND_LISTENER}\\\\\\\"\\\\n - name: BOOTSTRAP_SERVERS\\\\n value: ${BOOTSTRAP_SERVERS}\\\\n - name: RATIO\\\\n value: \\\\\\\"${RATIO}\\\\\\\"\\\\n - name: TEST_ID\\\\n value: ${TEST_ID}\\\\n - name: THREAD_NUM\\\\n value: \\\\\\\"${THREAD_NUM}\\\\\\\"\\\\n - name: HEAP\\\\n value: ${HEAP}\\\\n - name: REPORT_ID\\\\n value: ${REPORT_ID}\\\\n - name: RESOURCE_INDEX\\\\n value: \\\\\\\"${RESOURCE_INDEX}\\\\\\\"\\\\n - name: LOG_TOPIC\\\\n value: ${LOG_TOPIC}\\\\n - name: GC_ALGO\\\\n value: ${GC_ALGO}\\\\n image: ${JMETER_IMAGE}\\\\n imagePullPolicy: IfNotPresent\\\\n name: jmeter\\\\n ports:\\\\n - containerPort: 60000\\\\n protocol: TCP\\\\n volumeMounts:\\\\n - mountPath: /test\\\\n name: test-files\\\\n - mountPath: /jmeter-log\\\\n name: log-files\\\\n restartPolicy: Never\\\\n volumes:\\\\n - emptyDir: {}\\\\n name: test-files\\\\n - emptyDir: {}\\\\n name: log-files\\\\n\\\"}\"}]},{\"id\":\"cdbd4079-3b9a-4182-8d66-1cd24b66de68\",\"name\":\"k8s-20\",\"type\":\"K8S\",\"description\":null,\"status\":\"VALID\",\"createTime\":1720259252623,\"updateTime\":1720259252623,\"image\":null,\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"c73882d8-a063-4ae3-84ae-bada7f3e4aeb\",\"testResourcePoolId\":\"cdbd4079-3b9a-4182-8d66-1cd24b66de68\",\"status\":\"VALID\",\"createTime\":1720259252816,\"updateTime\":1720259252816,\"configuration\":\"{\\\"masterUrl\\\":\\\"https://172.16.10.200:6443\\\",\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsImtpZCI6IldrcGdYOGZMX2xCeFVtTTVEYnViTUtweGNIeHR5RGtQOWRtRWpWbjNrMlEifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrby1hZG1pbi10b2tlbi0yNGZ0dyIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJrby1hZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjczMWEyNzhiLTY3NDYtNDU2MC1iYjJmLTVhNzEyNzJmODVmZCIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlLXN5c3RlbTprby1hZG1pbiJ9.dpgXt9h51WnOQ9UjOuuhsNyCDrDFCFE6lk7w86VMP-OxLtJYbuYjrhxOUDrfRuz7SYRsjfWLKF-LaX0b_Hw7fccWKQoOZUJQTmw93TP1MpUqbhFlyw8anTsV_B2miPuWlZvj5IsU423X14kAngMsXPzJ_xItr1m3bcbbDFsavWlQTkhMi6b5pvhdio_bSomz34oe6m3KaZdLsD2N9gJuLkCZa5jG0aL1RgbLHVxdc85UqMMMZ-9puqozlRTlH1-DnHAitbIUUV6OIqU1wcKYzRcJsJ5qWnTne70B-2eygNMm17rQjyrIUQwNwdc5ucnYXCfJntnvZuZKLD41Sj7uUw\\\",\\\"namespace\\\":\\\"youly\\\",\\\"podThreadLimit\\\":5000,\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\",\\\"maxConcurrency\\\":100}\"}]},{\"id\":\"a360b679-88c6-4117-95dd-e4ea886b1b7d\",\"name\":\"test-wxg\",\"type\":\"NODE\",\"description\":null,\"status\":\"VALID\",\"createTime\":1717484452171,\"updateTime\":1717484452171,\"image\":null,\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":true,\"resources\":[{\"id\":\"7fb67a0a-1394-48cf-a0e6-43b2e05bead2\",\"testResourcePoolId\":\"a360b679-88c6-4117-95dd-e4ea886b1b7d\",\"status\":\"VALID\",\"createTime\":1717484452330,\"updateTime\":1717484452330,\"configuration\":\"{\\\"ip\\\":\\\"127.0.0.1\\\",\\\"port\\\":8082,\\\"monitorPort\\\":9100,\\\"maxConcurrency\\\":100}\"}]},{\"id\":\"0b9f70e4-f159-4f29-ad1a-d3dd6f0fd5cd\",\"name\":\"200.4\",\"type\":\"NODE\",\"description\":null,\"status\":\"VALID\",\"createTime\":1689921113954,\"updateTime\":1717483467267,\"image\":\"registry.cn-qingdao.aliyuncs.com/metersphere/jmeter-master:5.5-ms8-jdk17\",\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"54057a38-f3fe-4235-adc2-f7bff69b10a0\",\"testResourcePoolId\":\"0b9f70e4-f159-4f29-ad1a-d3dd6f0fd5cd\",\"status\":\"VALID\",\"createTime\":1717483467295,\"updateTime\":1717483467295,\"configuration\":\"{\\\"ip\\\":\\\"172.16.200.4\\\",\\\"port\\\":8082,\\\"monitorPort\\\":4523,\\\"maxConcurrency\\\":100,\\\"id\\\":\\\"54057a38-f3fe-4235-adc2-f7bff69b10a0\\\",\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\"}\"}]},{\"id\":\"03e331f4-6ac9-40c4-b3f9-b1789ae2f33d\",\"name\":\"155资源池\",\"type\":\"NODE\",\"description\":null,\"status\":\"VALID\",\"createTime\":1704865158507,\"updateTime\":1717483463658,\"image\":\"registry.cn-qingdao.aliyuncs.com/metersphere/jmeter-master:5.5-ms11-jdk17\",\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"b8ac7c2f-7e14-4e6e-b1b9-9a7184faca19\",\"testResourcePoolId\":\"03e331f4-6ac9-40c4-b3f9-b1789ae2f33d\",\"status\":\"VALID\",\"createTime\":1717483463676,\"updateTime\":1717483463676,\"configuration\":\"{\\\"ip\\\":\\\"172.16.10.155\\\",\\\"port\\\":8082,\\\"monitorPort\\\":913,\\\"maxConcurrency\\\":10,\\\"id\\\":\\\"b8ac7c2f-7e14-4e6e-b1b9-9a7184faca19\\\",\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\"}\"},{\"id\":\"6584492d-26e3-456d-a704-6d1eaae22c1b\",\"testResourcePoolId\":\"03e331f4-6ac9-40c4-b3f9-b1789ae2f33d\",\"status\":\"VALID\",\"createTime\":1717483463681,\"updateTime\":1717483463681,\"configuration\":\"{\\\"port\\\":8082,\\\"monitorPort\\\":9102,\\\"maxConcurrency\\\":100,\\\"ip\\\":\\\"172.16.10.66\\\",\\\"id\\\":\\\"6584492d-26e3-456d-a704-6d1eaae22c1b\\\",\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\"}\"}]},{\"id\":\"519956e3-4478-40d9-a616-8f7917286ea8\",\"name\":\"66关闭后置监听器\",\"type\":\"NODE\",\"description\":null,\"status\":\"VALID\",\"createTime\":1713246503327,\"updateTime\":1717483451098,\"image\":null,\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"c248e3fe-4cf6-4842-9f4e-014c23c3fe70\",\"testResourcePoolId\":\"519956e3-4478-40d9-a616-8f7917286ea8\",\"status\":\"VALID\",\"createTime\":1717483451105,\"updateTime\":1717483451105,\"configuration\":\"{\\\"ip\\\":\\\"172.16.10.66\\\",\\\"port\\\":8082,\\\"monitorPort\\\":9130,\\\"maxConcurrency\\\":100,\\\"id\\\":\\\"c248e3fe-4cf6-4842-9f4e-014c23c3fe70\\\",\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\"}\"}]}]}" + }, + "redirectURL": "", + "headersSize": 252, + "bodySize": 2856, + "_transferSize": 3108, + "_error": null, + "_fetchedViaServiceWorker": false + }, + "serverIPAddress": "172.16.10.66", + "startedDateTime": "2024-08-08T08:06:14.400Z", + "time": 103.04200000246055, + "timings": { + "blocked": 0.6499999854788184, + "dns": -1, + "ssl": -1, + "connect": -1, + "send": 0.02699999999999997, + "wait": 102.15499998954498, + "receive": 0.21000002743676305, + "_blocked_queueing": 0.2579999854788184, + "_workerStart": -1, + "_workerReady": -1, + "_workerFetchStart": -1, + "_workerRespondWithSettled": -1 + } + }, + { + "_initiator": { + "type": "script", + "stack": { + "callFrames": [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 145648 + }, + { + "functionName": "xhr", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 143691 + }, + { + "functionName": "Qt", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 150609 + } + ], + "parent": { + "description": "Promise.then", + "callFrames": [ + { + "functionName": "_request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 153327 + }, + { + "functionName": "request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 151983 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 121631 + }, + { + "functionName": "T", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 361243 + }, + { + "functionName": "n", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 19797 + }, + { + "functionName": "getDefaultQuota", + "scriptId": "49", + "url": "http://172.16.10.66:8081/js/setting-3617.3c6437cc.js", + "lineNumber": 0, + "columnNumber": 2149 + }, + { + "functionName": "mounted", + "scriptId": "49", + "url": "http://172.16.10.66:8081/js/setting-3617.3c6437cc.js", + "lineNumber": 0, + "columnNumber": 2545 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24950 + }, + { + "functionName": "zi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 33922 + }, + { + "functionName": "insert", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 37374 + }, + { + "functionName": "A", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 58002 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 59327 + }, + { + "functionName": "Pi.e._update", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 31510 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 32273 + }, + { + "functionName": "e.get", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 28492 + }, + { + "functionName": "e.run", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 29229 + }, + { + "functionName": "Qi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 34489 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26031 + }, + { + "functionName": "Yn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25426 + } + ], + "parent": { + "description": "Promise.then", + "callFrames": [ + { + "functionName": "Hn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25517 + }, + { + "functionName": "Qn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26096 + }, + { + "functionName": "ir", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 35002 + }, + { + "functionName": "e.update", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 29165 + }, + { + "functionName": "e.notify", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 6804 + }, + { + "functionName": "set", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 8662 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56623 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56594 + }, + { + "functionName": "et.updateRoute", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51463 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50046 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51328 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51259 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47670 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48404 + } + ], + "parent": { + "description": "Promise.then", + "callFrames": [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47847 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48039 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48015 + }, + { + "functionName": "Ke", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47965 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47474 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 400894 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "et.confirmTransition", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51194 + }, + { + "functionName": "et.transitionTo", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50012 + }, + { + "functionName": "t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 53641 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57086 + }, + { + "functionName": "_t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57049 + }, + { + "functionName": "f.Ay.push", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 389825 + }, + { + "functionName": "routeToItem", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110768 + }, + { + "functionName": "handleItemClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110374 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "Ai.e.$emit", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 30964 + }, + { + "functionName": "dispatch", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 620936 + }, + { + "functionName": "handleClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 120315 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "n", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 14734 + }, + { + "functionName": "Pa.o._wrapper", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 62419 + } + ] + } + } + } + } + }, + "_priority": "High", + "_resourceType": "xhr", + "cache": {}, + "connection": "1187648", + "request": { + "method": "GET", + "url": "http://172.16.10.66:8081/setting/quota/default/workspace", + "httpVersion": "HTTP/1.1", + "headers": [ + { + "name": "Accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "Accept-Encoding", + "value": "gzip, deflate" + }, + { + "name": "Accept-Language", + "value": "zh-CN" + }, + { + "name": "CSRF-TOKEN", + "value": "442WhMRQfh9N2uVKgj6YOWgY6JmGJk+MkyKq0N6UMrxgeyaiiAtqTAPNjI4bu6miUKuGeevt23GOhSuvD8agAXaVgK/j9LbBH0aqfaXc2KU=" + }, + { + "name": "Connection", + "value": "keep-alive" + }, + { + "name": "Host", + "value": "172.16.10.66:8081" + }, + { + "name": "PROJECT", + "value": "05a5c1ea-d1e2-4645-956f-6300d4becf00" + }, + { + "name": "Referer", + "value": "http://172.16.10.66:8081/" + }, + { + "name": "User-Agent", + "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36" + }, + { + "name": "WORKSPACE", + "value": "048b143c-e071-424f-b5fe-3ca89fb93c13" + }, + { + "name": "X-AUTH-TOKEN", + "value": "616e19c0-3b10-4391-81a9-401e6f6f1b34" + } + ], + "queryString": [ + { + "name": "workspace_id", + "value": "0" + }, + { + "name": "product_type", + "value": "1" + } + ], + "cookies": [], + "headersSize": 632, + "bodySize": 0 + }, + "response": { + "status": 200, + "statusText": "OK", + "httpVersion": "HTTP/1.1", + "headers": [ + { + "name": "Content-Encoding", + "value": "gzip" + }, + { + "name": "Content-Type", + "value": "application/json" + }, + { + "name": "Date", + "value": "Thu, 08 Aug 2024 08:05:45 GMT" + }, + { + "name": "Vary", + "value": "Origin" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Method" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Headers" + }, + { + "name": "Vary", + "value": "Accept-Encoding" + }, + { + "name": "transfer-encoding", + "value": "chunked" + } + ], + "cookies": [], + "content": { + "size": 612, + "mimeType": "application/json", + "compression": 185, + "text": "{\"success\":true,\"message\":null,\"data\":{\"id\":\"workspace\",\"api\":0,\"performance\":0,\"maxThreads\":0,\"duration\":0,\"resourcePool\":\"8c17bdc2-1817-11eb-92cf-0242ac120004,a360b679-88c6-4117-95dd-e4ea886b1b7d,519956e3-4478-40d9-a616-8f7917286ea8,132c515d-5d39-4c21-af1e-40c6b748d366,28947e4b-b2b5-4379-90d2-a6cf670b506e,0b9f70e4-f159-4f29-ad1a-d3dd6f0fd5cd,03e331f4-6ac9-40c4-b3f9-b1789ae2f33d,bafa05bb-d4f6-4eaf-a8de-0d895b80ed94\",\"workspaceId\":null,\"useDefault\":null,\"updateTime\":1721730820782,\"member\":0,\"project\":0,\"projectId\":null,\"vumTotal\":0.00,\"vumUsed\":null,\"moduleSetting\":\"workstation,track,api,ui,performance\"}}" + }, + "redirectURL": "", + "headersSize": 252, + "bodySize": 427, + "_transferSize": 679, + "_error": null, + "_fetchedViaServiceWorker": false + }, + "serverIPAddress": "172.16.10.66", + "startedDateTime": "2024-08-08T08:06:14.400Z", + "time": 88.29600000171922, + "timings": { + "blocked": 0.5319999881871045, + "dns": -1, + "ssl": -1, + "connect": -1, + "send": 0.01699999999999996, + "wait": 87.35399998962693, + "receive": 0.39300002390518785, + "_blocked_queueing": 0.26599998818710446, + "_workerStart": -1, + "_workerReady": -1, + "_workerFetchStart": -1, + "_workerRespondWithSettled": -1 + } + }, + { + "_initiator": { + "type": "script", + "stack": { + "callFrames": [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 145648 + }, + { + "functionName": "xhr", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 143691 + }, + { + "functionName": "Qt", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 150609 + } + ], + "parent": { + "description": "Promise.then", + "callFrames": [ + { + "functionName": "_request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 153327 + }, + { + "functionName": "request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 151983 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 121631 + }, + { + "functionName": "V", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 361292 + }, + { + "functionName": "c", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 19924 + }, + { + "functionName": "search", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 16984 + }, + { + "functionName": "activated", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 18373 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24950 + }, + { + "functionName": "zi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 33922 + }, + { + "functionName": "Ri", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 33591 + }, + { + "functionName": "Ri", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 33572 + }, + { + "functionName": "nr", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 34807 + }, + { + "functionName": "Qi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 34530 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26031 + }, + { + "functionName": "Yn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25426 + } + ], + "parent": { + "description": "Promise.then", + "callFrames": [ + { + "functionName": "Hn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25517 + }, + { + "functionName": "Qn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26096 + }, + { + "functionName": "ir", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 35002 + }, + { + "functionName": "e.update", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 29165 + }, + { + "functionName": "e.notify", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 6804 + }, + { + "functionName": "set", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 8662 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56623 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56594 + }, + { + "functionName": "et.updateRoute", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51463 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50046 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51328 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51259 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47670 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48404 + } + ], + "parent": { + "description": "Promise.then", + "callFrames": [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47847 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48039 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48015 + }, + { + "functionName": "Ke", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47965 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47474 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 400894 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "et.confirmTransition", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51194 + }, + { + "functionName": "et.transitionTo", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50012 + }, + { + "functionName": "t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 53641 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57086 + }, + { + "functionName": "_t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57049 + }, + { + "functionName": "f.Ay.push", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 389825 + }, + { + "functionName": "routeToItem", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110768 + }, + { + "functionName": "handleItemClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110374 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "Ai.e.$emit", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 30964 + }, + { + "functionName": "dispatch", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 620936 + }, + { + "functionName": "handleClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 120315 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "n", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 14734 + }, + { + "functionName": "Pa.o._wrapper", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 62419 + } + ] + } + } + } + } + }, + "_priority": "High", + "_resourceType": "xhr", + "cache": {}, + "connection": "1187567", + "request": { + "method": "POST", + "url": "http://172.16.10.66:8081/setting/quota/list/workspace/1/10", + "httpVersion": "HTTP/1.1", + "headers": [ + { + "name": "Accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "Accept-Encoding", + "value": "gzip, deflate" + }, + { + "name": "Accept-Language", + "value": "zh-CN" + }, + { + "name": "CSRF-TOKEN", + "value": "442WhMRQfh9N2uVKgj6YOWgY6JmGJk+MkyKq0N6UMrxgeyaiiAtqTAPNjI4bu6miUKuGeevt23GOhSuvD8agAXaVgK/j9LbBH0aqfaXc2KU=" + }, + { + "name": "Connection", + "value": "keep-alive" + }, + { + "name": "Content-Length", + "value": "2" + }, + { + "name": "Content-Type", + "value": "application/json" + }, + { + "name": "Host", + "value": "172.16.10.66:8081" + }, + { + "name": "Origin", + "value": "http://172.16.10.66:8081" + }, + { + "name": "PROJECT", + "value": "05a5c1ea-d1e2-4645-956f-6300d4becf00" + }, + { + "name": "Referer", + "value": "http://172.16.10.66:8081/" + }, + { + "name": "User-Agent", + "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36" + }, + { + "name": "WORKSPACE", + "value": "048b143c-e071-424f-b5fe-3ca89fb93c13" + }, + { + "name": "X-AUTH-TOKEN", + "value": "616e19c0-3b10-4391-81a9-401e6f6f1b34" + } + ], + "queryString": [], + "cookies": [], + "headersSize": 720, + "bodySize": 2, + "postData": { + "mimeType": "application/json", + "text": "{\"name\":\"abcdefghi\"}" + } + }, + "response": { + "status": 200, + "statusText": "OK", + "httpVersion": "HTTP/1.1", + "headers": [ + { + "name": "Content-Encoding", + "value": "gzip" + }, + { + "name": "Content-Type", + "value": "application/json" + }, + { + "name": "Date", + "value": "Thu, 08 Aug 2024 08:05:45 GMT" + }, + { + "name": "Vary", + "value": "Origin" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Method" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Headers" + }, + { + "name": "Vary", + "value": "Accept-Encoding" + }, + { + "name": "transfer-encoding", + "value": "chunked" + } + ], + "cookies": [], + "content": { + "size": 4081, + "mimeType": "application/json", + "compression": 3103, + "text": "{\"success\":true,\"message\":null,\"data\":{\"listObject\":[{\"id\":\"87c67f3c-cd5d-4b88-b7db-bf95f6e8553b\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"c239e34f-faf3-43d1-8294-4584731c199e\",\"useDefault\":true,\"updateTime\":1721784547632,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_ut4mjnvx\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"121bbe7d-bc40-4a9b-923f-d1cfa41003cd\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"d2658c95-7d7a-46f9-8928-e77e7f9d2b4e\",\"useDefault\":true,\"updateTime\":1721784542058,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_guPvyG90\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"2617aa3e-b887-49d8-8c73-e12aca1f8a82\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"5ecb39c8-7789-4882-b73d-e9613f310aa7\",\"useDefault\":true,\"updateTime\":1721784531076,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_xan83ZB7\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"8a9a28dd-5adf-4543-9bdc-af28907aba26\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"2729e83e-984a-4a50-ae9c-85b5f81346b0\",\"useDefault\":true,\"updateTime\":1721784526531,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_zfFEit0M\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"3cc53e8c-990c-4ffb-aa8c-8a9302969012\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"c6b164bb-3966-4c10-8ac1-2f451cab339f\",\"useDefault\":true,\"updateTime\":1721784517974,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_P0qyCMeh\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"bf75cfac-3f7e-4587-a5bc-de1014825597\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"97679d16-4f30-4df5-be45-f91379aecf19\",\"useDefault\":true,\"updateTime\":1721783923519,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_tQAI6tc4\",\"projectName\":null,\"projectUsed\":2},{\"id\":\"5510344a-d2cc-4587-a55e-2917f6514f7d\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"431e813d-5de5-4c1d-affe-34f8f15a1108\",\"useDefault\":true,\"updateTime\":1721783087058,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_2pA85Gpv\",\"projectName\":null,\"projectUsed\":1},{\"id\":\"46872b1b-372b-4de7-8f0b-53d065893f08\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"b1da8acc-cb55-450c-9189-a36e143cfa57\",\"useDefault\":true,\"updateTime\":1720175342992,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"guoxiaoyong\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"25d6051b-116a-4561-93b4-6bcd20b4803d\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"7caa64ef-1f1b-400c-964c-f52587856ccb\",\"useDefault\":true,\"updateTime\":1720075574958,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":0.17,\"moduleSetting\":null,\"workspaceName\":\"7.4工作空间-yc\",\"projectName\":null,\"projectUsed\":1},{\"id\":\"2f996458-fc84-42e7-813b-d802603acb2a\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"25140054-8520-4bc7-a231-76366f56cf78\",\"useDefault\":true,\"updateTime\":1719363182724,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_nBt3I17E\",\"projectName\":null,\"projectUsed\":0}],\"itemCount\":67,\"pageCount\":7}}" + }, + "redirectURL": "", + "headersSize": 252, + "bodySize": 978, + "_transferSize": 1230, + "_error": null, + "_fetchedViaServiceWorker": false + }, + "serverIPAddress": "172.16.10.66", + "startedDateTime": "2024-08-08T08:06:14.400Z", + "time": 153.65900000324473, + "timings": { + "blocked": 0.44200001695752145, + "dns": -1, + "ssl": -1, + "connect": -1, + "send": 0.022999999999999993, + "wait": 152.94599998964182, + "receive": 0.2479999966453761, + "_blocked_queueing": 0.30800001695752144, + "_workerStart": -1, + "_workerReady": -1, + "_workerFetchStart": -1, + "_workerRespondWithSettled": -1 + } + } + ] + } +} \ No newline at end of file diff --git a/backend/services/api-test/src/test/resources/file/import/har/simple.har b/backend/services/api-test/src/test/resources/file/import/har/simple.har new file mode 100644 index 0000000000..d08283b0db --- /dev/null +++ b/backend/services/api-test/src/test/resources/file/import/har/simple.har @@ -0,0 +1,2834 @@ +{ + "log": + { + "version": "1.2", + "creator": + { + "name": "WebInspector", + "version": "537.36" + }, + "pages": + [], + "entries": + [ + { + "_initiator": + { + "type": "script", + "stack": + { + "callFrames": + [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 145648 + }, + { + "functionName": "xhr", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 143691 + }, + { + "functionName": "Qt", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 150609 + } + ], + "parent": + { + "description": "Promise.then", + "callFrames": + [ + { + "functionName": "_request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 153327 + }, + { + "functionName": "request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 151983 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 121631 + }, + { + "functionName": "V", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 361292 + }, + { + "functionName": "c", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 19924 + }, + { + "functionName": "search", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 16984 + }, + { + "functionName": "mounted", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 18346 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24950 + }, + { + "functionName": "zi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 33922 + }, + { + "functionName": "insert", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 37374 + }, + { + "functionName": "A", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 58002 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 59327 + }, + { + "functionName": "Pi.e._update", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 31510 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 32273 + }, + { + "functionName": "e.get", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 28492 + }, + { + "functionName": "e.run", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 29229 + }, + { + "functionName": "Qi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 34489 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26031 + }, + { + "functionName": "Yn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25426 + } + ], + "parent": + { + "description": "Promise.then", + "callFrames": + [ + { + "functionName": "Hn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25517 + }, + { + "functionName": "Qn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26096 + }, + { + "functionName": "ir", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 35002 + }, + { + "functionName": "e.update", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 29165 + }, + { + "functionName": "e.notify", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 6804 + }, + { + "functionName": "set", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 8662 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56623 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56594 + }, + { + "functionName": "et.updateRoute", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51463 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50046 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51328 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51259 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47670 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48404 + } + ], + "parent": + { + "description": "Promise.then", + "callFrames": + [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47847 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48039 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48015 + }, + { + "functionName": "Ke", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47965 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47474 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 400894 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "et.confirmTransition", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51194 + }, + { + "functionName": "et.transitionTo", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50012 + }, + { + "functionName": "t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 53641 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57086 + }, + { + "functionName": "_t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57049 + }, + { + "functionName": "f.Ay.push", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 389825 + }, + { + "functionName": "routeToItem", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110768 + }, + { + "functionName": "handleItemClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110374 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "Ai.e.$emit", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 30964 + }, + { + "functionName": "dispatch", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 620936 + }, + { + "functionName": "handleClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 120315 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "n", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 14734 + }, + { + "functionName": "Pa.o._wrapper", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 62419 + } + ] + } + } + } + } + }, + "_priority": "High", + "_resourceType": "xhr", + "cache": + {}, + "connection": "1187519", + "request": + { + "method": "POST", + "url": "http://172.16.10.66:8081/setting/quota/list/workspace/1/10", + "httpVersion": "HTTP/1.1", + "headers": + [ + { + "name": "Accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "Accept-Encoding", + "value": "gzip, deflate" + }, + { + "name": "Accept-Language", + "value": "zh-CN" + }, + { + "name": "CSRF-TOKEN", + "value": "442WhMRQfh9N2uVKgj6YOWgY6JmGJk+MkyKq0N6UMrxgeyaiiAtqTAPNjI4bu6miUKuGeevt23GOhSuvD8agAXaVgK/j9LbBH0aqfaXc2KU=" + }, + { + "name": "Connection", + "value": "keep-alive" + }, + { + "name": "Content-Length", + "value": "2" + }, + { + "name": "Content-Type", + "value": "application/json" + }, + { + "name": "Host", + "value": "172.16.10.66:8081" + }, + { + "name": "Origin", + "value": "http://172.16.10.66:8081" + }, + { + "name": "PROJECT", + "value": "05a5c1ea-d1e2-4645-956f-6300d4becf00" + }, + { + "name": "Referer", + "value": "http://172.16.10.66:8081/" + }, + { + "name": "User-Agent", + "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36" + }, + { + "name": "WORKSPACE", + "value": "048b143c-e071-424f-b5fe-3ca89fb93c13" + }, + { + "name": "X-AUTH-TOKEN", + "value": "616e19c0-3b10-4391-81a9-401e6f6f1b34" + } + ], + "queryString": + [], + "cookies": + [], + "headersSize": 720, + "bodySize": 2, + "postData": + { + "mimeType": "application/json", + "text": "{}" + } + }, + "response": + { + "status": 200, + "statusText": "OK", + "httpVersion": "HTTP/1.1", + "headers": + [ + { + "name": "Content-Encoding", + "value": "gzip" + }, + { + "name": "Content-Type", + "value": "application/json" + }, + { + "name": "Date", + "value": "Thu, 08 Aug 2024 08:05:45 GMT" + }, + { + "name": "Vary", + "value": "Origin" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Method" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Headers" + }, + { + "name": "Vary", + "value": "Accept-Encoding" + }, + { + "name": "transfer-encoding", + "value": "chunked" + } + ], + "cookies": + [], + "content": + { + "size": 4081, + "mimeType": "application/json", + "compression": 3103, + "text": "{\"success\":true,\"message\":null,\"data\":{\"listObject\":[{\"id\":\"87c67f3c-cd5d-4b88-b7db-bf95f6e8553b\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"c239e34f-faf3-43d1-8294-4584731c199e\",\"useDefault\":true,\"updateTime\":1721784547632,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_ut4mjnvx\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"121bbe7d-bc40-4a9b-923f-d1cfa41003cd\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"d2658c95-7d7a-46f9-8928-e77e7f9d2b4e\",\"useDefault\":true,\"updateTime\":1721784542058,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_guPvyG90\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"2617aa3e-b887-49d8-8c73-e12aca1f8a82\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"5ecb39c8-7789-4882-b73d-e9613f310aa7\",\"useDefault\":true,\"updateTime\":1721784531076,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_xan83ZB7\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"8a9a28dd-5adf-4543-9bdc-af28907aba26\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"2729e83e-984a-4a50-ae9c-85b5f81346b0\",\"useDefault\":true,\"updateTime\":1721784526531,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_zfFEit0M\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"3cc53e8c-990c-4ffb-aa8c-8a9302969012\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"c6b164bb-3966-4c10-8ac1-2f451cab339f\",\"useDefault\":true,\"updateTime\":1721784517974,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_P0qyCMeh\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"bf75cfac-3f7e-4587-a5bc-de1014825597\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"97679d16-4f30-4df5-be45-f91379aecf19\",\"useDefault\":true,\"updateTime\":1721783923519,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_tQAI6tc4\",\"projectName\":null,\"projectUsed\":2},{\"id\":\"5510344a-d2cc-4587-a55e-2917f6514f7d\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"431e813d-5de5-4c1d-affe-34f8f15a1108\",\"useDefault\":true,\"updateTime\":1721783087058,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_2pA85Gpv\",\"projectName\":null,\"projectUsed\":1},{\"id\":\"46872b1b-372b-4de7-8f0b-53d065893f08\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"b1da8acc-cb55-450c-9189-a36e143cfa57\",\"useDefault\":true,\"updateTime\":1720175342992,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"guoxiaoyong\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"25d6051b-116a-4561-93b4-6bcd20b4803d\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"7caa64ef-1f1b-400c-964c-f52587856ccb\",\"useDefault\":true,\"updateTime\":1720075574958,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":0.17,\"moduleSetting\":null,\"workspaceName\":\"7.4工作空间-yc\",\"projectName\":null,\"projectUsed\":1},{\"id\":\"2f996458-fc84-42e7-813b-d802603acb2a\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"25140054-8520-4bc7-a231-76366f56cf78\",\"useDefault\":true,\"updateTime\":1719363182724,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_nBt3I17E\",\"projectName\":null,\"projectUsed\":0}],\"itemCount\":67,\"pageCount\":7}}" + }, + "redirectURL": "", + "headersSize": 252, + "bodySize": 978, + "_transferSize": 1230, + "_error": null, + "_fetchedViaServiceWorker": false + }, + "serverIPAddress": "172.16.10.66", + "startedDateTime": "2024-08-08T08:06:14.400Z", + "time": 154.3320000055246, + "timings": + { + "blocked": 0.6249999846555292, + "dns": -1, + "ssl": -1, + "connect": -1, + "send": 0.05700000000000002, + "wait": 153.4819999930989, + "receive": 0.16800002777017653, + "_blocked_queueing": 0.44899998465552926, + "_workerStart": -1, + "_workerReady": -1, + "_workerFetchStart": -1, + "_workerRespondWithSettled": -1 + } + }, + { + "_initiator": + { + "type": "script", + "stack": + { + "callFrames": + [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 145648 + }, + { + "functionName": "xhr", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 143691 + }, + { + "functionName": "Qt", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 150609 + } + ], + "parent": + { + "description": "Promise.then", + "callFrames": + [ + { + "functionName": "_request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 153327 + }, + { + "functionName": "request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 151983 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 121631 + }, + { + "functionName": "T", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 361243 + }, + { + "functionName": "i", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 19733 + }, + { + "functionName": "getResourcePool", + "scriptId": "49", + "url": "http://172.16.10.66:8081/js/setting-3617.3c6437cc.js", + "lineNumber": 0, + "columnNumber": 2049 + }, + { + "functionName": "mounted", + "scriptId": "49", + "url": "http://172.16.10.66:8081/js/setting-3617.3c6437cc.js", + "lineNumber": 0, + "columnNumber": 2522 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24950 + }, + { + "functionName": "zi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 33922 + }, + { + "functionName": "insert", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 37374 + }, + { + "functionName": "A", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 58002 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 59327 + }, + { + "functionName": "Pi.e._update", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 31510 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 32273 + }, + { + "functionName": "e.get", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 28492 + }, + { + "functionName": "e.run", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 29229 + }, + { + "functionName": "Qi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 34489 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26031 + }, + { + "functionName": "Yn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25426 + } + ], + "parent": + { + "description": "Promise.then", + "callFrames": + [ + { + "functionName": "Hn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25517 + }, + { + "functionName": "Qn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26096 + }, + { + "functionName": "ir", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 35002 + }, + { + "functionName": "e.update", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 29165 + }, + { + "functionName": "e.notify", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 6804 + }, + { + "functionName": "set", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 8662 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56623 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56594 + }, + { + "functionName": "et.updateRoute", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51463 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50046 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51328 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51259 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47670 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48404 + } + ], + "parent": + { + "description": "Promise.then", + "callFrames": + [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47847 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48039 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48015 + }, + { + "functionName": "Ke", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47965 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47474 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 400894 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "et.confirmTransition", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51194 + }, + { + "functionName": "et.transitionTo", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50012 + }, + { + "functionName": "t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 53641 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57086 + }, + { + "functionName": "_t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57049 + }, + { + "functionName": "f.Ay.push", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 389825 + }, + { + "functionName": "routeToItem", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110768 + }, + { + "functionName": "handleItemClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110374 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "Ai.e.$emit", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 30964 + }, + { + "functionName": "dispatch", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 620936 + }, + { + "functionName": "handleClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 120315 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "n", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 14734 + }, + { + "functionName": "Pa.o._wrapper", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 62419 + } + ] + } + } + } + } + }, + "_priority": "High", + "_resourceType": "xhr", + "cache": + {}, + "connection": "1187656", + "request": + { + "method": "GET", + "url": "http://172.16.10.66:8081/setting/testresourcepool/list/all/valid", + "httpVersion": "HTTP/1.1", + "headers": + [ + { + "name": "Accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "Accept-Encoding", + "value": "gzip, deflate" + }, + { + "name": "Accept-Language", + "value": "zh-CN" + }, + { + "name": "CSRF-TOKEN", + "value": "442WhMRQfh9N2uVKgj6YOWgY6JmGJk+MkyKq0N6UMrxgeyaiiAtqTAPNjI4bu6miUKuGeevt23GOhSuvD8agAXaVgK/j9LbBH0aqfaXc2KU=" + }, + { + "name": "Connection", + "value": "keep-alive" + }, + { + "name": "Host", + "value": "172.16.10.66:8081" + }, + { + "name": "PROJECT", + "value": "05a5c1ea-d1e2-4645-956f-6300d4becf00" + }, + { + "name": "Referer", + "value": "http://172.16.10.66:8081/" + }, + { + "name": "User-Agent", + "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36" + }, + { + "name": "WORKSPACE", + "value": "048b143c-e071-424f-b5fe-3ca89fb93c13" + }, + { + "name": "X-AUTH-TOKEN", + "value": "616e19c0-3b10-4391-81a9-401e6f6f1b34" + } + ], + "queryString": + [], + "cookies": + [], + "headersSize": 640, + "bodySize": 0 + }, + "response": + { + "status": 200, + "statusText": "OK", + "httpVersion": "HTTP/1.1", + "headers": + [ + { + "name": "Content-Encoding", + "value": "gzip" + }, + { + "name": "Content-Type", + "value": "application/json" + }, + { + "name": "Date", + "value": "Thu, 08 Aug 2024 08:05:45 GMT" + }, + { + "name": "Vary", + "value": "Origin" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Method" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Headers" + }, + { + "name": "Vary", + "value": "Accept-Encoding" + }, + { + "name": "transfer-encoding", + "value": "chunked" + } + ], + "cookies": + [], + "content": + { + "size": 10961, + "mimeType": "application/json", + "compression": 8105, + "text": "{\"success\":true,\"message\":null,\"data\":[{\"id\":\"8c17bdc2-1817-11eb-92cf-0242ac120004\",\"name\":\"LOCAL\",\"type\":\"NODE\",\"description\":\"系统默认创建的本地资源池\",\"status\":\"VALID\",\"createTime\":1603777497000,\"updateTime\":1721965035953,\"image\":\"registry.cn-qingdao.aliyuncs.com/metersphere/jmeter-master:5.5-ms12-jdk17\",\"heap\":\"-Xms4g -Xmx4g -XX:MaxMetaspaceSize=2048m\",\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"8c17fc37-1817-11eb-92cf-0242ac120004\",\"testResourcePoolId\":\"8c17bdc2-1817-11eb-92cf-0242ac120004\",\"status\":\"VALID\",\"createTime\":1721965035956,\"updateTime\":1721965035956,\"configuration\":\"{\\\"port\\\":8082,\\\"maxConcurrency\\\":5000,\\\"ip\\\":\\\"ms-node-controller\\\",\\\"id\\\":\\\"8c17fc37-1817-11eb-92cf-0242ac120004\\\",\\\"monitorPort\\\":9100,\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\",\\\"enable\\\":true}\"}]},{\"id\":\"bafa05bb-d4f6-4eaf-a8de-0d895b80ed94\",\"name\":\"副老师的资源池\",\"type\":\"NODE\",\"description\":null,\"status\":\"VALID\",\"createTime\":1721730696108,\"updateTime\":1721730709537,\"image\":\"registry.cn-qingdao.aliyuncs.com/metersphere/jmeter-master:5.5-ms12-jdk17\",\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"5d45cbd9-78aa-4488-b619-a1d3d5057cdd\",\"testResourcePoolId\":\"bafa05bb-d4f6-4eaf-a8de-0d895b80ed94\",\"status\":\"VALID\",\"createTime\":1721730709543,\"updateTime\":1721730709543,\"configuration\":\"{\\\"ip\\\":\\\"172.16.200.15\\\",\\\"port\\\":8082,\\\"monitorPort\\\":9100,\\\"maxConcurrency\\\":100,\\\"id\\\":\\\"5d45cbd9-78aa-4488-b619-a1d3d5057cdd\\\",\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\"}\"}]},{\"id\":\"28947e4b-b2b5-4379-90d2-a6cf670b506e\",\"name\":\"66资源池\",\"type\":\"NODE\",\"description\":null,\"status\":\"VALID\",\"createTime\":1689760838776,\"updateTime\":1721369328900,\"image\":\"registry.cn-qingdao.aliyuncs.com/metersphere/jmeter-master:5.5-ms12-jdk17\",\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"9ffc1be4-bb29-4114-8648-0376a171f916\",\"testResourcePoolId\":\"28947e4b-b2b5-4379-90d2-a6cf670b506e\",\"status\":\"VALID\",\"createTime\":1721369328936,\"updateTime\":1721369328936,\"configuration\":\"{\\\"ip\\\":\\\"172.16.10.66\\\",\\\"port\\\":8082,\\\"monitorPort\\\":435,\\\"maxConcurrency\\\":5000,\\\"id\\\":\\\"9ffc1be4-bb29-4114-8648-0376a171f916\\\",\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\"}\"}]},{\"id\":\"132c515d-5d39-4c21-af1e-40c6b748d366\",\"name\":\"K8s-200\",\"type\":\"K8S\",\"description\":null,\"status\":\"VALID\",\"createTime\":1690536571532,\"updateTime\":1720259779615,\"image\":\"registry.cn-qingdao.aliyuncs.com/metersphere/jmeter-master:5.5-ms9-jdk17\",\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"11cdfe06-0f34-4589-982d-04f6462f9e83\",\"testResourcePoolId\":\"132c515d-5d39-4c21-af1e-40c6b748d366\",\"status\":\"VALID\",\"createTime\":1720259779780,\"updateTime\":1720259779780,\"configuration\":\"{\\\"masterUrl\\\":\\\"https://172.16.10.200:6443\\\",\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsImtpZCI6IldrcGdYOGZMX2xCeFVtTTVEYnViTUtweGNIeHR5RGtQOWRtRWpWbjNrMlEifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrby1hZG1pbi10b2tlbi0yNGZ0dyIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJrby1hZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjczMWEyNzhiLTY3NDYtNDU2MC1iYjJmLTVhNzEyNzJmODVmZCIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlLXN5c3RlbTprby1hZG1pbiJ9.dpgXt9h51WnOQ9UjOuuhsNyCDrDFCFE6lk7w86VMP-OxLtJYbuYjrhxOUDrfRuz7SYRsjfWLKF-LaX0b_Hw7fccWKQoOZUJQTmw93TP1MpUqbhFlyw8anTsV_B2miPuWlZvj5IsU423X14kAngMsXPzJ_xItr1m3bcbbDFsavWlQTkhMi6b5pvhdio_bSomz34oe6m3KaZdLsD2N9gJuLkCZa5jG0aL1RgbLHVxdc85UqMMMZ-9puqozlRTlH1-DnHAitbIUUV6OIqU1wcKYzRcJsJ5qWnTne70B-2eygNMm17rQjyrIUQwNwdc5ucnYXCfJntnvZuZKLD41Sj7uUw\\\",\\\"namespace\\\":\\\"youly\\\",\\\"podThreadLimit\\\":5000,\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\",\\\"maxConcurrency\\\":100,\\\"enable\\\":false,\\\"id\\\":\\\"11cdfe06-0f34-4589-982d-04f6462f9e83\\\",\\\"monitorPort\\\":\\\"9100\\\",\\\"jobTemplate\\\":\\\"apiVersion: batch/v1\\\\nkind: Job\\\\nmetadata:\\\\n labels:\\\\n test-id: ${TEST_ID}\\\\n name: ${JOB_NAME}\\\\nspec:\\\\n parallelism: 1\\\\n template:\\\\n metadata:\\\\n labels:\\\\n test-id: ${TEST_ID}\\\\n spec:\\\\n containers:\\\\n - command:\\\\n - sh\\\\n - -c\\\\n - /run-test.sh\\\\n env:\\\\n - name: START_TIME\\\\n value: \\\\\\\"${START_TIME}\\\\\\\"\\\\n - name: GRANULARITY\\\\n value: \\\\\\\"${GRANULARITY}\\\\\\\"\\\\n - name: JMETER_REPORTS_TOPIC\\\\n value: ${JMETER_REPORTS_TOPIC}\\\\n - name: METERSPHERE_URL\\\\n value: ${METERSPHERE_URL}\\\\n - name: RESOURCE_ID\\\\n value: ${RESOURCE_ID}\\\\n - name: BACKEND_LISTENER\\\\n value: \\\\\\\"${BACKEND_LISTENER}\\\\\\\"\\\\n - name: BOOTSTRAP_SERVERS\\\\n value: ${BOOTSTRAP_SERVERS}\\\\n - name: RATIO\\\\n value: \\\\\\\"${RATIO}\\\\\\\"\\\\n - name: TEST_ID\\\\n value: ${TEST_ID}\\\\n - name: THREAD_NUM\\\\n value: \\\\\\\"${THREAD_NUM}\\\\\\\"\\\\n - name: HEAP\\\\n value: ${HEAP}\\\\n - name: REPORT_ID\\\\n value: ${REPORT_ID}\\\\n - name: RESOURCE_INDEX\\\\n value: \\\\\\\"${RESOURCE_INDEX}\\\\\\\"\\\\n - name: LOG_TOPIC\\\\n value: ${LOG_TOPIC}\\\\n - name: GC_ALGO\\\\n value: ${GC_ALGO}\\\\n image: ${JMETER_IMAGE}\\\\n imagePullPolicy: IfNotPresent\\\\n name: jmeter\\\\n ports:\\\\n - containerPort: 60000\\\\n protocol: TCP\\\\n volumeMounts:\\\\n - mountPath: /test\\\\n name: test-files\\\\n - mountPath: /jmeter-log\\\\n name: log-files\\\\n restartPolicy: Never\\\\n volumes:\\\\n - emptyDir: {}\\\\n name: test-files\\\\n - emptyDir: {}\\\\n name: log-files\\\\n\\\"}\"}]},{\"id\":\"cdbd4079-3b9a-4182-8d66-1cd24b66de68\",\"name\":\"k8s-20\",\"type\":\"K8S\",\"description\":null,\"status\":\"VALID\",\"createTime\":1720259252623,\"updateTime\":1720259252623,\"image\":null,\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"c73882d8-a063-4ae3-84ae-bada7f3e4aeb\",\"testResourcePoolId\":\"cdbd4079-3b9a-4182-8d66-1cd24b66de68\",\"status\":\"VALID\",\"createTime\":1720259252816,\"updateTime\":1720259252816,\"configuration\":\"{\\\"masterUrl\\\":\\\"https://172.16.10.200:6443\\\",\\\"token\\\":\\\"eyJhbGciOiJSUzI1NiIsImtpZCI6IldrcGdYOGZMX2xCeFVtTTVEYnViTUtweGNIeHR5RGtQOWRtRWpWbjNrMlEifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrby1hZG1pbi10b2tlbi0yNGZ0dyIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJrby1hZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjczMWEyNzhiLTY3NDYtNDU2MC1iYjJmLTVhNzEyNzJmODVmZCIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlLXN5c3RlbTprby1hZG1pbiJ9.dpgXt9h51WnOQ9UjOuuhsNyCDrDFCFE6lk7w86VMP-OxLtJYbuYjrhxOUDrfRuz7SYRsjfWLKF-LaX0b_Hw7fccWKQoOZUJQTmw93TP1MpUqbhFlyw8anTsV_B2miPuWlZvj5IsU423X14kAngMsXPzJ_xItr1m3bcbbDFsavWlQTkhMi6b5pvhdio_bSomz34oe6m3KaZdLsD2N9gJuLkCZa5jG0aL1RgbLHVxdc85UqMMMZ-9puqozlRTlH1-DnHAitbIUUV6OIqU1wcKYzRcJsJ5qWnTne70B-2eygNMm17rQjyrIUQwNwdc5ucnYXCfJntnvZuZKLD41Sj7uUw\\\",\\\"namespace\\\":\\\"youly\\\",\\\"podThreadLimit\\\":5000,\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\",\\\"maxConcurrency\\\":100}\"}]},{\"id\":\"a360b679-88c6-4117-95dd-e4ea886b1b7d\",\"name\":\"test-wxg\",\"type\":\"NODE\",\"description\":null,\"status\":\"VALID\",\"createTime\":1717484452171,\"updateTime\":1717484452171,\"image\":null,\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":true,\"resources\":[{\"id\":\"7fb67a0a-1394-48cf-a0e6-43b2e05bead2\",\"testResourcePoolId\":\"a360b679-88c6-4117-95dd-e4ea886b1b7d\",\"status\":\"VALID\",\"createTime\":1717484452330,\"updateTime\":1717484452330,\"configuration\":\"{\\\"ip\\\":\\\"127.0.0.1\\\",\\\"port\\\":8082,\\\"monitorPort\\\":9100,\\\"maxConcurrency\\\":100}\"}]},{\"id\":\"0b9f70e4-f159-4f29-ad1a-d3dd6f0fd5cd\",\"name\":\"200.4\",\"type\":\"NODE\",\"description\":null,\"status\":\"VALID\",\"createTime\":1689921113954,\"updateTime\":1717483467267,\"image\":\"registry.cn-qingdao.aliyuncs.com/metersphere/jmeter-master:5.5-ms8-jdk17\",\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"54057a38-f3fe-4235-adc2-f7bff69b10a0\",\"testResourcePoolId\":\"0b9f70e4-f159-4f29-ad1a-d3dd6f0fd5cd\",\"status\":\"VALID\",\"createTime\":1717483467295,\"updateTime\":1717483467295,\"configuration\":\"{\\\"ip\\\":\\\"172.16.200.4\\\",\\\"port\\\":8082,\\\"monitorPort\\\":4523,\\\"maxConcurrency\\\":100,\\\"id\\\":\\\"54057a38-f3fe-4235-adc2-f7bff69b10a0\\\",\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\"}\"}]},{\"id\":\"03e331f4-6ac9-40c4-b3f9-b1789ae2f33d\",\"name\":\"155资源池\",\"type\":\"NODE\",\"description\":null,\"status\":\"VALID\",\"createTime\":1704865158507,\"updateTime\":1717483463658,\"image\":\"registry.cn-qingdao.aliyuncs.com/metersphere/jmeter-master:5.5-ms11-jdk17\",\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"b8ac7c2f-7e14-4e6e-b1b9-9a7184faca19\",\"testResourcePoolId\":\"03e331f4-6ac9-40c4-b3f9-b1789ae2f33d\",\"status\":\"VALID\",\"createTime\":1717483463676,\"updateTime\":1717483463676,\"configuration\":\"{\\\"ip\\\":\\\"172.16.10.155\\\",\\\"port\\\":8082,\\\"monitorPort\\\":913,\\\"maxConcurrency\\\":10,\\\"id\\\":\\\"b8ac7c2f-7e14-4e6e-b1b9-9a7184faca19\\\",\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\"}\"},{\"id\":\"6584492d-26e3-456d-a704-6d1eaae22c1b\",\"testResourcePoolId\":\"03e331f4-6ac9-40c4-b3f9-b1789ae2f33d\",\"status\":\"VALID\",\"createTime\":1717483463681,\"updateTime\":1717483463681,\"configuration\":\"{\\\"port\\\":8082,\\\"monitorPort\\\":9102,\\\"maxConcurrency\\\":100,\\\"ip\\\":\\\"172.16.10.66\\\",\\\"id\\\":\\\"6584492d-26e3-456d-a704-6d1eaae22c1b\\\",\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\"}\"}]},{\"id\":\"519956e3-4478-40d9-a616-8f7917286ea8\",\"name\":\"66关闭后置监听器\",\"type\":\"NODE\",\"description\":null,\"status\":\"VALID\",\"createTime\":1713246503327,\"updateTime\":1717483451098,\"image\":null,\"heap\":null,\"gcAlgo\":null,\"createUser\":null,\"api\":true,\"performance\":true,\"backendListener\":false,\"resources\":[{\"id\":\"c248e3fe-4cf6-4842-9f4e-014c23c3fe70\",\"testResourcePoolId\":\"519956e3-4478-40d9-a616-8f7917286ea8\",\"status\":\"VALID\",\"createTime\":1717483451105,\"updateTime\":1717483451105,\"configuration\":\"{\\\"ip\\\":\\\"172.16.10.66\\\",\\\"port\\\":8082,\\\"monitorPort\\\":9130,\\\"maxConcurrency\\\":100,\\\"id\\\":\\\"c248e3fe-4cf6-4842-9f4e-014c23c3fe70\\\",\\\"deployType\\\":\\\"DaemonSet\\\",\\\"deployName\\\":\\\"ms-node-controller\\\"}\"}]}]}" + }, + "redirectURL": "", + "headersSize": 252, + "bodySize": 2856, + "_transferSize": 3108, + "_error": null, + "_fetchedViaServiceWorker": false + }, + "serverIPAddress": "172.16.10.66", + "startedDateTime": "2024-08-08T08:06:14.400Z", + "time": 103.04200000246055, + "timings": + { + "blocked": 0.6499999854788184, + "dns": -1, + "ssl": -1, + "connect": -1, + "send": 0.02699999999999997, + "wait": 102.15499998954498, + "receive": 0.21000002743676305, + "_blocked_queueing": 0.2579999854788184, + "_workerStart": -1, + "_workerReady": -1, + "_workerFetchStart": -1, + "_workerRespondWithSettled": -1 + } + }, + { + "_initiator": + { + "type": "script", + "stack": + { + "callFrames": + [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 145648 + }, + { + "functionName": "xhr", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 143691 + }, + { + "functionName": "Qt", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 150609 + } + ], + "parent": + { + "description": "Promise.then", + "callFrames": + [ + { + "functionName": "_request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 153327 + }, + { + "functionName": "request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 151983 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 121631 + }, + { + "functionName": "T", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 361243 + }, + { + "functionName": "n", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 19797 + }, + { + "functionName": "getDefaultQuota", + "scriptId": "49", + "url": "http://172.16.10.66:8081/js/setting-3617.3c6437cc.js", + "lineNumber": 0, + "columnNumber": 2149 + }, + { + "functionName": "mounted", + "scriptId": "49", + "url": "http://172.16.10.66:8081/js/setting-3617.3c6437cc.js", + "lineNumber": 0, + "columnNumber": 2545 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24950 + }, + { + "functionName": "zi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 33922 + }, + { + "functionName": "insert", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 37374 + }, + { + "functionName": "A", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 58002 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 59327 + }, + { + "functionName": "Pi.e._update", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 31510 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 32273 + }, + { + "functionName": "e.get", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 28492 + }, + { + "functionName": "e.run", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 29229 + }, + { + "functionName": "Qi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 34489 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26031 + }, + { + "functionName": "Yn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25426 + } + ], + "parent": + { + "description": "Promise.then", + "callFrames": + [ + { + "functionName": "Hn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25517 + }, + { + "functionName": "Qn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26096 + }, + { + "functionName": "ir", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 35002 + }, + { + "functionName": "e.update", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 29165 + }, + { + "functionName": "e.notify", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 6804 + }, + { + "functionName": "set", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 8662 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56623 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56594 + }, + { + "functionName": "et.updateRoute", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51463 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50046 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51328 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51259 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47670 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48404 + } + ], + "parent": + { + "description": "Promise.then", + "callFrames": + [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47847 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48039 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48015 + }, + { + "functionName": "Ke", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47965 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47474 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 400894 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "et.confirmTransition", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51194 + }, + { + "functionName": "et.transitionTo", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50012 + }, + { + "functionName": "t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 53641 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57086 + }, + { + "functionName": "_t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57049 + }, + { + "functionName": "f.Ay.push", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 389825 + }, + { + "functionName": "routeToItem", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110768 + }, + { + "functionName": "handleItemClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110374 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "Ai.e.$emit", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 30964 + }, + { + "functionName": "dispatch", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 620936 + }, + { + "functionName": "handleClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 120315 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "n", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 14734 + }, + { + "functionName": "Pa.o._wrapper", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 62419 + } + ] + } + } + } + } + }, + "_priority": "High", + "_resourceType": "xhr", + "cache": + {}, + "connection": "1187648", + "request": + { + "method": "GET", + "url": "http://172.16.10.66:8081/setting/quota/default/workspace", + "httpVersion": "HTTP/1.1", + "headers": + [ + { + "name": "Accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "Accept-Encoding", + "value": "gzip, deflate" + }, + { + "name": "Accept-Language", + "value": "zh-CN" + }, + { + "name": "CSRF-TOKEN", + "value": "442WhMRQfh9N2uVKgj6YOWgY6JmGJk+MkyKq0N6UMrxgeyaiiAtqTAPNjI4bu6miUKuGeevt23GOhSuvD8agAXaVgK/j9LbBH0aqfaXc2KU=" + }, + { + "name": "Connection", + "value": "keep-alive" + }, + { + "name": "Host", + "value": "172.16.10.66:8081" + }, + { + "name": "PROJECT", + "value": "05a5c1ea-d1e2-4645-956f-6300d4becf00" + }, + { + "name": "Referer", + "value": "http://172.16.10.66:8081/" + }, + { + "name": "User-Agent", + "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36" + }, + { + "name": "WORKSPACE", + "value": "048b143c-e071-424f-b5fe-3ca89fb93c13" + }, + { + "name": "X-AUTH-TOKEN", + "value": "616e19c0-3b10-4391-81a9-401e6f6f1b34" + } + ], + "queryString": + [], + "cookies": + [], + "headersSize": 632, + "bodySize": 0 + }, + "response": + { + "status": 200, + "statusText": "OK", + "httpVersion": "HTTP/1.1", + "headers": + [ + { + "name": "Content-Encoding", + "value": "gzip" + }, + { + "name": "Content-Type", + "value": "application/json" + }, + { + "name": "Date", + "value": "Thu, 08 Aug 2024 08:05:45 GMT" + }, + { + "name": "Vary", + "value": "Origin" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Method" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Headers" + }, + { + "name": "Vary", + "value": "Accept-Encoding" + }, + { + "name": "transfer-encoding", + "value": "chunked" + } + ], + "cookies": + [], + "content": + { + "size": 612, + "mimeType": "application/json", + "compression": 185, + "text": "{\"success\":true,\"message\":null,\"data\":{\"id\":\"workspace\",\"api\":0,\"performance\":0,\"maxThreads\":0,\"duration\":0,\"resourcePool\":\"8c17bdc2-1817-11eb-92cf-0242ac120004,a360b679-88c6-4117-95dd-e4ea886b1b7d,519956e3-4478-40d9-a616-8f7917286ea8,132c515d-5d39-4c21-af1e-40c6b748d366,28947e4b-b2b5-4379-90d2-a6cf670b506e,0b9f70e4-f159-4f29-ad1a-d3dd6f0fd5cd,03e331f4-6ac9-40c4-b3f9-b1789ae2f33d,bafa05bb-d4f6-4eaf-a8de-0d895b80ed94\",\"workspaceId\":null,\"useDefault\":null,\"updateTime\":1721730820782,\"member\":0,\"project\":0,\"projectId\":null,\"vumTotal\":0.00,\"vumUsed\":null,\"moduleSetting\":\"workstation,track,api,ui,performance\"}}" + }, + "redirectURL": "", + "headersSize": 252, + "bodySize": 427, + "_transferSize": 679, + "_error": null, + "_fetchedViaServiceWorker": false + }, + "serverIPAddress": "172.16.10.66", + "startedDateTime": "2024-08-08T08:06:14.400Z", + "time": 88.29600000171922, + "timings": + { + "blocked": 0.5319999881871045, + "dns": -1, + "ssl": -1, + "connect": -1, + "send": 0.01699999999999996, + "wait": 87.35399998962693, + "receive": 0.39300002390518785, + "_blocked_queueing": 0.26599998818710446, + "_workerStart": -1, + "_workerReady": -1, + "_workerFetchStart": -1, + "_workerRespondWithSettled": -1 + } + }, + { + "_initiator": + { + "type": "script", + "stack": + { + "callFrames": + [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 145648 + }, + { + "functionName": "xhr", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 143691 + }, + { + "functionName": "Qt", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 150609 + } + ], + "parent": + { + "description": "Promise.then", + "callFrames": + [ + { + "functionName": "_request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 153327 + }, + { + "functionName": "request", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 151983 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 121631 + }, + { + "functionName": "V", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 361292 + }, + { + "functionName": "c", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 19924 + }, + { + "functionName": "search", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 16984 + }, + { + "functionName": "activated", + "scriptId": "47", + "url": "http://172.16.10.66:8081/js/setting-8711.e5990e2c.js", + "lineNumber": 0, + "columnNumber": 18373 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24950 + }, + { + "functionName": "zi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 33922 + }, + { + "functionName": "Ri", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 33591 + }, + { + "functionName": "Ri", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 33572 + }, + { + "functionName": "nr", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 34807 + }, + { + "functionName": "Qi", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 34530 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26031 + }, + { + "functionName": "Yn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25426 + } + ], + "parent": + { + "description": "Promise.then", + "callFrames": + [ + { + "functionName": "Hn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 25517 + }, + { + "functionName": "Qn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 26096 + }, + { + "functionName": "ir", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 35002 + }, + { + "functionName": "e.update", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 29165 + }, + { + "functionName": "e.notify", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 6804 + }, + { + "functionName": "set", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 8662 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56623 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 56594 + }, + { + "functionName": "et.updateRoute", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51463 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50046 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51328 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51259 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47365 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47670 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48404 + } + ], + "parent": + { + "description": "Promise.then", + "callFrames": + [ + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47847 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48039 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 48015 + }, + { + "functionName": "Ke", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47965 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47474 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47393 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51170 + }, + { + "functionName": "eval", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 400894 + }, + { + "functionName": "f", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50924 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47374 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "i", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47403 + }, + { + "functionName": "Ge", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 47411 + }, + { + "functionName": "et.confirmTransition", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 51194 + }, + { + "functionName": "et.transitionTo", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 50012 + }, + { + "functionName": "t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 53641 + }, + { + "functionName": "eval", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57086 + }, + { + "functionName": "_t.push", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 86, + "columnNumber": 57049 + }, + { + "functionName": "f.Ay.push", + "scriptId": "25", + "url": "http://172.16.10.66:8081/js/setting-app.31dcaa0a.js", + "lineNumber": 0, + "columnNumber": 389825 + }, + { + "functionName": "routeToItem", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110768 + }, + { + "functionName": "handleItemClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 110374 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "Ai.e.$emit", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 30964 + }, + { + "functionName": "dispatch", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 620936 + }, + { + "functionName": "handleClick", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 44, + "columnNumber": 120315 + }, + { + "functionName": "zn", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 24937 + }, + { + "functionName": "n", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 14734 + }, + { + "functionName": "Pa.o._wrapper", + "scriptId": "24", + "url": "http://172.16.10.66:8081/js/setting-chunk-vendors.e1465f79.js", + "lineNumber": 94, + "columnNumber": 62419 + } + ] + } + } + } + } + }, + "_priority": "High", + "_resourceType": "xhr", + "cache": + {}, + "connection": "1187567", + "request": + { + "method": "POST", + "url": "http://172.16.10.66:8081/setting/quota/list/workspace/1/10", + "httpVersion": "HTTP/1.1", + "headers": + [ + { + "name": "Accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "Accept-Encoding", + "value": "gzip, deflate" + }, + { + "name": "Accept-Language", + "value": "zh-CN" + }, + { + "name": "CSRF-TOKEN", + "value": "442WhMRQfh9N2uVKgj6YOWgY6JmGJk+MkyKq0N6UMrxgeyaiiAtqTAPNjI4bu6miUKuGeevt23GOhSuvD8agAXaVgK/j9LbBH0aqfaXc2KU=" + }, + { + "name": "Connection", + "value": "keep-alive" + }, + { + "name": "Content-Length", + "value": "2" + }, + { + "name": "Content-Type", + "value": "application/json" + }, + { + "name": "Host", + "value": "172.16.10.66:8081" + }, + { + "name": "Origin", + "value": "http://172.16.10.66:8081" + }, + { + "name": "PROJECT", + "value": "05a5c1ea-d1e2-4645-956f-6300d4becf00" + }, + { + "name": "Referer", + "value": "http://172.16.10.66:8081/" + }, + { + "name": "User-Agent", + "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36" + }, + { + "name": "WORKSPACE", + "value": "048b143c-e071-424f-b5fe-3ca89fb93c13" + }, + { + "name": "X-AUTH-TOKEN", + "value": "616e19c0-3b10-4391-81a9-401e6f6f1b34" + } + ], + "queryString": + [], + "cookies": + [], + "headersSize": 720, + "bodySize": 2, + "postData": + { + "mimeType": "application/json", + "text": "{}" + } + }, + "response": + { + "status": 200, + "statusText": "OK", + "httpVersion": "HTTP/1.1", + "headers": + [ + { + "name": "Content-Encoding", + "value": "gzip" + }, + { + "name": "Content-Type", + "value": "application/json" + }, + { + "name": "Date", + "value": "Thu, 08 Aug 2024 08:05:45 GMT" + }, + { + "name": "Vary", + "value": "Origin" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Method" + }, + { + "name": "Vary", + "value": "Access-Control-Request-Headers" + }, + { + "name": "Vary", + "value": "Accept-Encoding" + }, + { + "name": "transfer-encoding", + "value": "chunked" + } + ], + "cookies": + [], + "content": + { + "size": 4081, + "mimeType": "application/json", + "compression": 3103, + "text": "{\"success\":true,\"message\":null,\"data\":{\"listObject\":[{\"id\":\"87c67f3c-cd5d-4b88-b7db-bf95f6e8553b\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"c239e34f-faf3-43d1-8294-4584731c199e\",\"useDefault\":true,\"updateTime\":1721784547632,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_ut4mjnvx\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"121bbe7d-bc40-4a9b-923f-d1cfa41003cd\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"d2658c95-7d7a-46f9-8928-e77e7f9d2b4e\",\"useDefault\":true,\"updateTime\":1721784542058,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_guPvyG90\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"2617aa3e-b887-49d8-8c73-e12aca1f8a82\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"5ecb39c8-7789-4882-b73d-e9613f310aa7\",\"useDefault\":true,\"updateTime\":1721784531076,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_xan83ZB7\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"8a9a28dd-5adf-4543-9bdc-af28907aba26\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"2729e83e-984a-4a50-ae9c-85b5f81346b0\",\"useDefault\":true,\"updateTime\":1721784526531,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_zfFEit0M\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"3cc53e8c-990c-4ffb-aa8c-8a9302969012\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"c6b164bb-3966-4c10-8ac1-2f451cab339f\",\"useDefault\":true,\"updateTime\":1721784517974,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_P0qyCMeh\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"bf75cfac-3f7e-4587-a5bc-de1014825597\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"97679d16-4f30-4df5-be45-f91379aecf19\",\"useDefault\":true,\"updateTime\":1721783923519,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_tQAI6tc4\",\"projectName\":null,\"projectUsed\":2},{\"id\":\"5510344a-d2cc-4587-a55e-2917f6514f7d\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"431e813d-5de5-4c1d-affe-34f8f15a1108\",\"useDefault\":true,\"updateTime\":1721783087058,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_2pA85Gpv\",\"projectName\":null,\"projectUsed\":1},{\"id\":\"46872b1b-372b-4de7-8f0b-53d065893f08\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"b1da8acc-cb55-450c-9189-a36e143cfa57\",\"useDefault\":true,\"updateTime\":1720175342992,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"guoxiaoyong\",\"projectName\":null,\"projectUsed\":0},{\"id\":\"25d6051b-116a-4561-93b4-6bcd20b4803d\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"7caa64ef-1f1b-400c-964c-f52587856ccb\",\"useDefault\":true,\"updateTime\":1720075574958,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":0.17,\"moduleSetting\":null,\"workspaceName\":\"7.4工作空间-yc\",\"projectName\":null,\"projectUsed\":1},{\"id\":\"2f996458-fc84-42e7-813b-d802603acb2a\",\"api\":null,\"performance\":null,\"maxThreads\":null,\"duration\":null,\"resourcePool\":null,\"workspaceId\":\"25140054-8520-4bc7-a231-76366f56cf78\",\"useDefault\":true,\"updateTime\":1719363182724,\"member\":null,\"project\":null,\"projectId\":null,\"vumTotal\":null,\"vumUsed\":null,\"moduleSetting\":null,\"workspaceName\":\"工作空间_nBt3I17E\",\"projectName\":null,\"projectUsed\":0}],\"itemCount\":67,\"pageCount\":7}}" + }, + "redirectURL": "", + "headersSize": 252, + "bodySize": 978, + "_transferSize": 1230, + "_error": null, + "_fetchedViaServiceWorker": false + }, + "serverIPAddress": "172.16.10.66", + "startedDateTime": "2024-08-08T08:06:14.400Z", + "time": 153.65900000324473, + "timings": + { + "blocked": 0.44200001695752145, + "dns": -1, + "ssl": -1, + "connect": -1, + "send": 0.022999999999999993, + "wait": 152.94599998964182, + "receive": 0.2479999966453761, + "_blocked_queueing": 0.30800001695752144, + "_workerStart": -1, + "_workerReady": -1, + "_workerFetchStart": -1, + "_workerRespondWithSettled": -1 + } + } + ] + } +} \ No newline at end of file diff --git a/backend/services/api-test/src/test/resources/file/import/har/single.har b/backend/services/api-test/src/test/resources/file/import/har/single.har new file mode 100644 index 0000000000..f5dde64711 --- /dev/null +++ b/backend/services/api-test/src/test/resources/file/import/har/single.har @@ -0,0 +1,346 @@ +{ + "log": + { + "version": "1.2", + "creator": + { + "name": "WebInspector", + "version": "537.36" + }, + "pages": + [], + "entries": + [ + { + "_initiator": + { + "type": "script", + "stack": + { + "callFrames": + [ + { + "functionName": "", + "scriptId": "9", + "url": "http://172.16.200.18:8081/assets/index-33SgBhcr.js", + "lineNumber": 1, + "columnNumber": 597486 + }, + { + "functionName": "xhr", + "scriptId": "9", + "url": "http://172.16.200.18:8081/assets/index-33SgBhcr.js", + "lineNumber": 1, + "columnNumber": 595339 + }, + { + "functionName": "dispatchRequest", + "scriptId": "9", + "url": "http://172.16.200.18:8081/assets/index-33SgBhcr.js", + "lineNumber": 1, + "columnNumber": 603441 + } + ], + "parent": + { + "description": "Promise.then", + "callFrames": + [ + { + "functionName": "_request", + "scriptId": "9", + "url": "http://172.16.200.18:8081/assets/index-33SgBhcr.js", + "lineNumber": 1, + "columnNumber": 606591 + }, + { + "functionName": "request", + "scriptId": "9", + "url": "http://172.16.200.18:8081/assets/index-33SgBhcr.js", + "lineNumber": 1, + "columnNumber": 605135 + }, + { + "functionName": "", + "scriptId": "9", + "url": "http://172.16.200.18:8081/assets/index-33SgBhcr.js", + "lineNumber": 1, + "columnNumber": 570981 + }, + { + "functionName": "", + "scriptId": "9", + "url": "http://172.16.200.18:8081/assets/index-33SgBhcr.js", + "lineNumber": 19, + "columnNumber": 40121 + }, + { + "functionName": "uploadFile", + "scriptId": "9", + "url": "http://172.16.200.18:8081/assets/index-33SgBhcr.js", + "lineNumber": 19, + "columnNumber": 40082 + }, + { + "functionName": "x", + "scriptId": "160", + "url": "http://172.16.200.18:8081/assets/fileManagement-BwbfbuXX.js", + "lineNumber": 0, + "columnNumber": 1108 + }, + { + "functionName": "uploadFileFromQueue", + "scriptId": "163", + "url": "http://172.16.200.18:8081/assets/fileList-BCu6BLjh.js", + "lineNumber": 0, + "columnNumber": 3648 + }, + { + "functionName": "", + "scriptId": "11", + "url": "http://172.16.200.18:8081/assets/vue-CKjJUztO.js", + "lineNumber": 48, + "columnNumber": 2244 + }, + { + "functionName": "startUpload", + "scriptId": "163", + "url": "http://172.16.200.18:8081/assets/fileList-BCu6BLjh.js", + "lineNumber": 0, + "columnNumber": 4116 + }, + { + "functionName": "", + "scriptId": "11", + "url": "http://172.16.200.18:8081/assets/vue-CKjJUztO.js", + "lineNumber": 48, + "columnNumber": 2244 + }, + { + "functionName": "Q", + "scriptId": "163", + "url": "http://172.16.200.18:8081/assets/fileList-BCu6BLjh.js", + "lineNumber": 0, + "columnNumber": 6637 + }, + { + "functionName": "cl", + "scriptId": "158", + "url": "http://172.16.200.18:8081/assets/index-DVkmz8YF.js", + "lineNumber": 0, + "columnNumber": 34186 + }, + { + "functionName": "jt", + "scriptId": "11", + "url": "http://172.16.200.18:8081/assets/vue-CKjJUztO.js", + "lineNumber": 12, + "columnNumber": 2794 + }, + { + "functionName": "St", + "scriptId": "11", + "url": "http://172.16.200.18:8081/assets/vue-CKjJUztO.js", + "lineNumber": 12, + "columnNumber": 2865 + }, + { + "functionName": "xm", + "scriptId": "11", + "url": "http://172.16.200.18:8081/assets/vue-CKjJUztO.js", + "lineNumber": 12, + "columnNumber": 5396 + }, + { + "functionName": "handleClick", + "scriptId": "12", + "url": "http://172.16.200.18:8081/assets/arco-g73YkF1H.js", + "lineNumber": 0, + "columnNumber": 51176 + }, + { + "functionName": "e.href.B.onClick.t..t.", + "scriptId": "12", + "url": "http://172.16.200.18:8081/assets/arco-g73YkF1H.js", + "lineNumber": 0, + "columnNumber": 51921 + }, + { + "functionName": "jt", + "scriptId": "11", + "url": "http://172.16.200.18:8081/assets/vue-CKjJUztO.js", + "lineNumber": 12, + "columnNumber": 2794 + }, + { + "functionName": "St", + "scriptId": "11", + "url": "http://172.16.200.18:8081/assets/vue-CKjJUztO.js", + "lineNumber": 12, + "columnNumber": 2865 + }, + { + "functionName": "n", + "scriptId": "11", + "url": "http://172.16.200.18:8081/assets/vue-CKjJUztO.js", + "lineNumber": 16, + "columnNumber": 8410 + } + ] + } + } + }, + "_priority": "High", + "_resourceType": "xhr", + "cache": + {}, + "connection": "1124737", + "request": + { + "method": "POST", + "url": "http://172.16.200.18:8081/project/file/upload", + "httpVersion": "HTTP/1.1", + "headers": + [ + { + "name": "Accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "Accept-Encoding", + "value": "gzip, deflate" + }, + { + "name": "Accept-Language", + "value": "zh-CN" + }, + { + "name": "CSRF-TOKEN", + "value": "WOtvvhbURKiZae0Sdo8uOD28+DK1/M+gXEdZkuu8iUBub/ak4c06ys1okPHqSfEKUiDI4HjdnqBddZeYuF2g0p+oRDeGoUHUtrM1wiGylvQ=" + }, + { + "name": "Connection", + "value": "keep-alive" + }, + { + "name": "Content-Length", + "value": "54729" + }, + { + "name": "Content-Type", + "value": "multipart/form-data; boundary=----WebKitFormBoundaryNkMIhRd5puIb9Jo6" + }, + { + "name": "Host", + "value": "172.16.200.18:8081" + }, + { + "name": "ORGANIZATION", + "value": "717345437786112" + }, + { + "name": "Origin", + "value": "http://172.16.200.18:8081" + }, + { + "name": "PROJECT", + "value": "997050905108480" + }, + { + "name": "Referer", + "value": "http://172.16.200.18:8081/" + }, + { + "name": "User-Agent", + "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36" + }, + { + "name": "X-AUTH-TOKEN", + "value": "61afde41-15d2-47c1-b1d1-751a4bed99f9" + } + ], + "queryString": + [], + "cookies": + [], + "headersSize": 726, + "bodySize": 406, + "postData": + { + "mimeType": "multipart/form-data; boundary=----WebKitFormBoundaryNkMIhRd5puIb9Jo6", + "text": "------WebKitFormBoundaryNkMIhRd5puIb9Jo6\r\nContent-Disposition: form-data; name=\"file\"; filename=\"IMG_5695.PNG\"\r\nContent-Type: image/png\r\n\r\n\r\n------WebKitFormBoundaryNkMIhRd5puIb9Jo6\r\nContent-Disposition: form-data; name=\"request\"; filename=\"blob\"\r\nContent-Type: application/json;charset=utf-8\r\n\r\n{\"projectId\":\"997050905108480\",\"moduleId\":\"root\",\"enable\":false}\r\n------WebKitFormBoundaryNkMIhRd5puIb9Jo6--\r\n", + "params": + [ + { + "name": "file", + "value": "(binary)" + }, + { + "name": "request", + "value": "(binary)" + } + ] + } + }, + "response": + { + "status": 200, + "statusText": "OK", + "httpVersion": "HTTP/1.1", + "headers": + [ + { + "name": "Content-Length", + "value": "77" + }, + { + "name": "Content-Type", + "value": "application/json" + }, + { + "name": "Date", + "value": "Thu, 08 Aug 2024 03:33:47 GMT" + }, + { + "name": "Vary", + "value": "Accept-Encoding" + } + ], + "cookies": + [], + "content": + { + "size": 77, + "mimeType": "application/json", + "compression": 0, + "text": "{\"code\":100200,\"message\":null,\"messageDetail\":null,\"data\":\"2199504316596224\"}" + }, + "redirectURL": "", + "headersSize": 131, + "bodySize": 77, + "_transferSize": 208, + "_error": null, + "_fetchedViaServiceWorker": false + }, + "serverIPAddress": "172.16.200.18", + "startedDateTime": "2024-08-08T03:33:47.873Z", + "time": 691.4930000063777, + "timings": + { + "blocked": 1.7159999903719871, + "dns": 0.17, + "ssl": -1, + "connect": 0.701, + "send": 1.067, + "wait": 687.6599999917876, + "receive": 0.17900002421811223, + "_blocked_queueing": 1.5619999903719872, + "_workerStart": -1, + "_workerReady": -1, + "_workerFetchStart": -1, + "_workerRespondWithSettled": -1 + } + } + ] + } +} \ No newline at end of file diff --git a/backend/services/api-test/src/test/resources/file/import/metersphere/repeatFileDiffApi.json b/backend/services/api-test/src/test/resources/file/import/metersphere/repeatFileDiffApi.json new file mode 100644 index 0000000000..6c9122af57 --- /dev/null +++ b/backend/services/api-test/src/test/resources/file/import/metersphere/repeatFileDiffApi.json @@ -0,0 +1,1271 @@ +{ + "apiDefinitions": [ + { + "id": null, + "name": "put的mock请求", + "protocol": "HTTP", + "method": "PUT", + "path": "/mock-server/100080/100005/mock-for-put", + "status": "PROCESSING", + "num": null, + "tags": [], + "pos": 8192, + "projectId": null, + "moduleId": null, + "latest": null, + "versionId": null, + "refId": null, + "description": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteUser": null, + "deleteTime": null, + "deleted": null, + "request": { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "put的mock请求", + "enable": true, + "children": [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "postProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "assertionConfig": { + "enableGlobal": true, + "assertions": [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100005/mock-for-put", + "method": "PUT", + "body": { + "bodyType": "FORM_DATA", + "noneBody": {}, + "formDataBody": { + "formValues": [ + { + "key": "methodttt", + "value": "putttttttt", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": { + "formValues": [] + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": { + "formValues": [ + { + "key": "methodttt", + "value": "putttttttt", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": [], + "rest": [], + "query": [], + "otherConfig": { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": false, + "autoRedirects": true + }, + "authConfig": { + "authType": "NONE", + "basicAuth": { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "response": [], + "modulePath": "正常请求的集合", + "apiTestCaseList": [ + { + "id": null, + "name": "put的mock请求ex1", + "priority": "P0", + "num": null, + "status": "PROCESSING", + "lastReportStatus": "PENDING", + "lastReportId": null, + "projectId": null, + "apiDefinitionId": null, + "apiDefinitionNum": null, + "apiDefinitionName": null, + "environmentId": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteTime": null, + "deleteUser": null, + "follow": null, + "method": null, + "path": null, + "environmentName": null, + "createName": null, + "updateName": null, + "deleteName": null, + "tags": [], + "passRate": null, + "request": { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "put的mock请求ex1", + "enable": true, + "children": [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "postProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "assertionConfig": { + "enableGlobal": true, + "assertions": [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100005/mock-for-put", + "method": "PUT", + "body": { + "bodyType": "FORM_DATA", + "noneBody": {}, + "formDataBody": { + "formValues": [ + { + "key": "method", + "value": "put-ex1", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": { + "formValues": [] + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": { + "formValues": [ + { + "key": "method", + "value": "put-ex1", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": [], + "rest": [], + "query": [], + "otherConfig": { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": true, + "autoRedirects": false + }, + "authConfig": { + "authType": "NONE", + "basicAuth": { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "modulePath": null, + "moduleId": null, + "protocol": null, + "apiChange": null, + "inconsistentWithApi": null, + "ignoreApiDiff": null, + "ignoreApiChange": null + }, + { + "id": null, + "name": "用于验证名字一样的用例1", + "priority": "P0", + "num": null, + "status": "PROCESSING", + "lastReportStatus": "PENDING", + "lastReportId": null, + "projectId": null, + "apiDefinitionId": null, + "apiDefinitionNum": null, + "apiDefinitionName": null, + "environmentId": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteTime": null, + "deleteUser": null, + "follow": null, + "method": null, + "path": null, + "environmentName": null, + "createName": null, + "updateName": null, + "deleteName": null, + "tags": [], + "passRate": null, + "request": { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "put的mock请求ex2", + "enable": true, + "children": [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "postProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "assertionConfig": { + "enableGlobal": true, + "assertions": [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100005/mock-for-put", + "method": "PUT", + "body": { + "bodyType": "FORM_DATA", + "noneBody": {}, + "formDataBody": { + "formValues": [ + { + "key": "method", + "value": "put-ex1", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": { + "formValues": [] + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": { + "formValues": [ + { + "key": "method", + "value": "put-ex1", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": [], + "rest": [], + "query": [], + "otherConfig": { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": true, + "autoRedirects": false + }, + "authConfig": { + "authType": "NONE", + "basicAuth": { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "modulePath": null, + "moduleId": null, + "protocol": null, + "apiChange": null, + "inconsistentWithApi": null, + "ignoreApiDiff": null, + "ignoreApiChange": null + } + ], + "apiMockList": [] + }, + { + "id": null, + "name": "put的mock请求-另一个", + "protocol": "HTTP", + "method": "PUT", + "path": "/mock-server/100080/100005/mock-for-put", + "status": "PROCESSING", + "num": null, + "tags": [], + "pos": 8192, + "projectId": null, + "moduleId": null, + "latest": null, + "versionId": null, + "refId": null, + "description": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteUser": null, + "deleteTime": null, + "deleted": null, + "request": { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "put的mock请求", + "enable": true, + "children": [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "postProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "assertionConfig": { + "enableGlobal": true, + "assertions": [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100005/mock-for-put", + "method": "PUT", + "body": { + "bodyType": "FORM_DATA", + "noneBody": {}, + "formDataBody": { + "formValues": [ + { + "key": "methodttt", + "value": "putttttt", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": { + "formValues": [] + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": { + "formValues": [ + { + "key": "methodttt", + "value": "putttttt", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": [], + "rest": [], + "query": [], + "otherConfig": { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": false, + "autoRedirects": true + }, + "authConfig": { + "authType": "NONE", + "basicAuth": { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "response": [], + "modulePath": "正常请求的集合", + "apiTestCaseList": [ + { + "id": null, + "name": "用于验证名字一样的用例1", + "priority": "P0", + "num": null, + "status": "PROCESSING", + "lastReportStatus": "PENDING", + "lastReportId": null, + "projectId": null, + "apiDefinitionId": null, + "apiDefinitionNum": null, + "apiDefinitionName": null, + "environmentId": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteTime": null, + "deleteUser": null, + "follow": null, + "method": null, + "path": null, + "environmentName": null, + "createName": null, + "updateName": null, + "deleteName": null, + "tags": [], + "passRate": null, + "request": { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "put的mock-copy请求ex", + "enable": true, + "children": [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "postProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "assertionConfig": { + "enableGlobal": true, + "assertions": [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100005/mock-for-put", + "method": "PUT", + "body": { + "bodyType": "FORM_DATA", + "noneBody": {}, + "formDataBody": { + "formValues": [ + { + "key": "method", + "value": "put", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": { + "formValues": [] + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": { + "formValues": [ + { + "key": "method", + "value": "put", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": [], + "rest": [], + "query": [], + "otherConfig": { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": true, + "autoRedirects": false + }, + "authConfig": { + "authType": "NONE", + "basicAuth": { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "modulePath": null, + "moduleId": null, + "protocol": null, + "apiChange": null, + "inconsistentWithApi": null, + "ignoreApiDiff": null, + "ignoreApiChange": null + }, + { + "id": null, + "name": "用于验证名字一样的用例1", + "priority": "P0", + "num": null, + "status": "PROCESSING", + "lastReportStatus": "PENDING", + "lastReportId": null, + "projectId": null, + "apiDefinitionId": null, + "apiDefinitionNum": null, + "apiDefinitionName": null, + "environmentId": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteTime": null, + "deleteUser": null, + "follow": null, + "method": null, + "path": null, + "environmentName": null, + "createName": null, + "updateName": null, + "deleteName": null, + "tags": [], + "passRate": null, + "request": { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "put的mock-copy请求ex2", + "enable": true, + "children": [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "postProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "assertionConfig": { + "enableGlobal": true, + "assertions": [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100005/mock-for-put", + "method": "PUT", + "body": { + "bodyType": "FORM_DATA", + "noneBody": {}, + "formDataBody": { + "formValues": [ + { + "key": "method", + "value": "put", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": { + "formValues": [] + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": { + "formValues": [ + { + "key": "method", + "value": "put", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": [], + "rest": [], + "query": [], + "otherConfig": { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": true, + "autoRedirects": false + }, + "authConfig": { + "authType": "NONE", + "basicAuth": { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "modulePath": null, + "moduleId": null, + "protocol": null, + "apiChange": null, + "inconsistentWithApi": null, + "ignoreApiDiff": null, + "ignoreApiChange": null + } + ], + "apiMockList": [] + }, + { + "id": null, + "name": "post的mock请求", + "protocol": "HTTP", + "method": "POST", + "path": "/mock-server/100080/100004/mock-for-post", + "status": "PROCESSING", + "num": null, + "tags": [], + "pos": 12288, + "projectId": null, + "moduleId": null, + "latest": null, + "versionId": null, + "refId": null, + "description": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteUser": null, + "deleteTime": null, + "deleted": null, + "request": { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "post的mock请求", + "enable": true, + "children": [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "postProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "assertionConfig": { + "enableGlobal": true, + "assertions": [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100004/mock-for-post", + "method": "POST", + "body": { + "bodyType": "FORM_DATA", + "noneBody": {}, + "formDataBody": { + "formValues": [ + { + "key": "methodttt", + "value": "postttttttt", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": { + "formValues": [] + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": { + "formValues": [ + { + "key": "method", + "value": "post", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": [], + "rest": [], + "query": [], + "otherConfig": { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": false, + "autoRedirects": true + }, + "authConfig": { + "authType": "NONE", + "basicAuth": { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "response": [], + "modulePath": "正常请求的集合", + "apiTestCaseList": [], + "apiMockList": [] + }, + { + "id": null, + "name": "https://api.tapd.cn/stories?workspace_id=1&id=2", + "protocol": "HTTP", + "method": "GET", + "path": "/stories", + "status": "PROCESSING", + "num": null, + "tags": [], + "pos": 16384, + "projectId": null, + "moduleId": null, + "latest": null, + "versionId": null, + "refId": null, + "description": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteUser": null, + "deleteTime": null, + "deleted": null, + "request": { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "https://api.tapd.cn/stories?workspace_id=1&id=2", + "enable": true, + "children": [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "postProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "assertionConfig": { + "enableGlobal": true, + "assertions": [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/stories", + "method": "GET", + "body": { + "bodyType": "NONE", + "noneBody": {}, + "formDataBody": { + "formValues": [] + }, + "wwwFormBody": { + "formValues": [] + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.NoneBody", + "bodyDataByType": {} + }, + "headers": [], + "rest": [], + "query": [ + { + "key": "w", + "value": "11111111", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "encode": false, + "valid": true, + "notBlankValue": true + }, + { + "key": "id", + "value": "222", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "encode": false, + "valid": true, + "notBlankValue": true + } + ], + "otherConfig": { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": false, + "autoRedirects": true + }, + "authConfig": { + "authType": "BASIC", + "basicAuth": { + "userName": "HIGKLMN", + "password": "ABCDEFG", + "valid": true + }, + "digestAuth": { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": true + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "response": [], + "modulePath": "正常请求的集合", + "apiTestCaseList": [], + "apiMockList": [] + } + ] +} \ No newline at end of file diff --git a/backend/services/api-test/src/test/resources/file/import/metersphere/repeatFileDiffModule.json b/backend/services/api-test/src/test/resources/file/import/metersphere/repeatFileDiffModule.json new file mode 100644 index 0000000000..ee703cd579 --- /dev/null +++ b/backend/services/api-test/src/test/resources/file/import/metersphere/repeatFileDiffModule.json @@ -0,0 +1,617 @@ +{ + "apiDefinitions": [ + { + "id": null, + "name": "put的mock请求", + "protocol": "HTTP", + "method": "PUT", + "path": "/mock-server/100080/100005/mock-for-put", + "status": "PROCESSING", + "num": null, + "tags": [], + "pos": 8192, + "projectId": null, + "moduleId": null, + "latest": null, + "versionId": null, + "refId": null, + "description": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteUser": null, + "deleteTime": null, + "deleted": null, + "request": { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "put的mock请求", + "enable": true, + "children": [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "postProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "assertionConfig": { + "enableGlobal": true, + "assertions": [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100005/mock-for-put", + "method": "PUT", + "body": { + "bodyType": "FORM_DATA", + "noneBody": {}, + "formDataBody": { + "formValues": [ + { + "key": "methodttt", + "value": "postttttttt", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": { + "formValues": [] + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": { + "formValues": [ + { + "key": "method", + "value": "putttttttt", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": [], + "rest": [], + "query": [], + "otherConfig": { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": false, + "autoRedirects": true + }, + "authConfig": { + "authType": "NONE", + "basicAuth": { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "response": [], + "modulePath": "正常/请求的/集合", + "apiTestCaseList": [], + "apiMockList": [] + }, + { + "id": null, + "name": "put的mock请求-另一个", + "protocol": "HTTP", + "method": "PUT", + "path": "/mock-server/100080/100005/mock-for-put", + "status": "PROCESSING", + "num": null, + "tags": [], + "pos": 8192, + "projectId": null, + "moduleId": null, + "latest": null, + "versionId": null, + "refId": null, + "description": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteUser": null, + "deleteTime": null, + "deleted": null, + "request": { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "put的mock请求", + "enable": true, + "children": [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "postProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "assertionConfig": { + "enableGlobal": true, + "assertions": [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100005/mock-for-put", + "method": "PUT", + "body": { + "bodyType": "FORM_DATA", + "noneBody": {}, + "formDataBody": { + "formValues": [ + { + "key": "methodttt", + "value": "putttttttt", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": { + "formValues": [] + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": { + "formValues": [ + { + "key": "method", + "value": "putttttt", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": [], + "rest": [], + "query": [], + "otherConfig": { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": false, + "autoRedirects": true + }, + "authConfig": { + "authType": "NONE", + "basicAuth": { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "response": [], + "modulePath": "正常/请求的/集合", + "apiTestCaseList": [], + "apiMockList": [] + }, + { + "id": null, + "name": "post的mock请求", + "protocol": "HTTP", + "method": "POST", + "path": "/mock-server/100080/100004/mock-for-post", + "status": "PROCESSING", + "num": null, + "tags": [], + "pos": 12288, + "projectId": null, + "moduleId": null, + "latest": null, + "versionId": null, + "refId": null, + "description": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteUser": null, + "deleteTime": null, + "deleted": null, + "request": { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "post的mock请求", + "enable": true, + "children": [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "postProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "assertionConfig": { + "enableGlobal": true, + "assertions": [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100004/mock-for-post", + "method": "POST", + "body": { + "bodyType": "FORM_DATA", + "noneBody": {}, + "formDataBody": { + "formValues": [ + { + "key": "methodttt", + "value": "postttttttt", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": { + "formValues": [] + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": { + "formValues": [ + { + "key": "method", + "value": "post", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": [], + "rest": [], + "query": [], + "otherConfig": { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": false, + "autoRedirects": true + }, + "authConfig": { + "authType": "NONE", + "basicAuth": { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "response": [], + "modulePath": "不正常请求的集合", + "apiTestCaseList": [], + "apiMockList": [] + }, + { + "id": null, + "name": "https://api.tapd.cn/stories?workspace_id=1&id=2", + "protocol": "HTTP", + "method": "GET", + "path": "/stories", + "status": "PROCESSING", + "num": null, + "tags": [], + "pos": 16384, + "projectId": null, + "moduleId": null, + "latest": null, + "versionId": null, + "refId": null, + "description": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteUser": null, + "deleteTime": null, + "deleted": null, + "request": { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "https://api.tapd.cn/stories?workspace_id=1&id=2", + "enable": true, + "children": [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "postProcessorConfig": { + "enableGlobal": true, + "processors": [] + }, + "assertionConfig": { + "enableGlobal": true, + "assertions": [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/stories", + "method": "GET", + "body": { + "bodyType": "NONE", + "noneBody": {}, + "formDataBody": { + "formValues": [] + }, + "wwwFormBody": { + "formValues": [] + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.NoneBody", + "bodyDataByType": {} + }, + "headers": [], + "rest": [], + "query": [ + { + "key": "w", + "value": "1", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "encode": false, + "valid": true, + "notBlankValue": true + }, + { + "key": "id", + "value": "2", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "encode": false, + "valid": true, + "notBlankValue": true + } + ], + "otherConfig": { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": false, + "autoRedirects": true + }, + "authConfig": { + "authType": "BASIC", + "basicAuth": { + "userName": "HIGKLMN", + "password": "ABCDEFG", + "valid": true + }, + "digestAuth": { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": true + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "response": [], + "modulePath": "不正常请求/集合", + "apiTestCaseList": [], + "apiMockList": [] + } + ] +} \ No newline at end of file diff --git a/backend/services/api-test/src/test/resources/file/import/metersphere/simple.json b/backend/services/api-test/src/test/resources/file/import/metersphere/simple.json new file mode 100644 index 0000000000..a4628248d3 --- /dev/null +++ b/backend/services/api-test/src/test/resources/file/import/metersphere/simple.json @@ -0,0 +1,3770 @@ +{ + "apiDefinitions": + [ + { + "id": null, + "name": "put的mock请求", + "protocol": "HTTP", + "method": "PUT", + "path": "/mock-server/100080/100005/mock-for-put", + "status": "PROCESSING", + "num": null, + "tags": + [], + "pos": 8192, + "projectId": null, + "moduleId": null, + "latest": null, + "versionId": null, + "refId": null, + "description": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteUser": null, + "deleteTime": null, + "deleted": null, + "request": + { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "put的mock请求", + "enable": true, + "children": + [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "postProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "assertionConfig": + { + "enableGlobal": true, + "assertions": + [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100005/mock-for-put", + "method": "PUT", + "body": + { + "bodyType": "FORM_DATA", + "noneBody": + {}, + "formDataBody": + { + "formValues": + [ + { + "key": "method", + "value": "put", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": + { + "formValues": + [] + }, + "jsonBody": + { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": + { + "value": null + }, + "rawBody": + { + "value": null + }, + "binaryBody": + { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": + { + "formValues": + [ + { + "key": "method", + "value": "put", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": + [], + "rest": + [], + "query": + [], + "otherConfig": + { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": false, + "autoRedirects": true + }, + "authConfig": + { + "authType": "NONE", + "basicAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "response": + [], + "modulePath": "正常请求的集合", + "apiTestCaseList": + [ + { + "id": null, + "name": "put的mock请求ex1", + "priority": "P0", + "num": null, + "status": "PROCESSING", + "lastReportStatus": "PENDING", + "lastReportId": null, + "projectId": null, + "apiDefinitionId": null, + "apiDefinitionNum": null, + "apiDefinitionName": null, + "environmentId": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteTime": null, + "deleteUser": null, + "follow": null, + "method": null, + "path": null, + "environmentName": null, + "createName": null, + "updateName": null, + "deleteName": null, + "tags": + [], + "passRate": null, + "request": + { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "put的mock请求ex1", + "enable": true, + "children": + [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "postProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "assertionConfig": + { + "enableGlobal": true, + "assertions": + [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100005/mock-for-put", + "method": "PUT", + "body": + { + "bodyType": "FORM_DATA", + "noneBody": + {}, + "formDataBody": + { + "formValues": + [ + { + "key": "method", + "value": "put-ex1", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": + { + "formValues": + [] + }, + "jsonBody": + { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": + { + "value": null + }, + "rawBody": + { + "value": null + }, + "binaryBody": + { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": + { + "formValues": + [ + { + "key": "method", + "value": "put-ex1", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": + [], + "rest": + [], + "query": + [], + "otherConfig": + { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": true, + "autoRedirects": false + }, + "authConfig": + { + "authType": "NONE", + "basicAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "modulePath": null, + "moduleId": null, + "protocol": null, + "apiChange": null, + "inconsistentWithApi": null, + "ignoreApiDiff": null, + "ignoreApiChange": null + }, + { + "id": null, + "name": "put的mock请求ex2", + "priority": "P0", + "num": null, + "status": "PROCESSING", + "lastReportStatus": "PENDING", + "lastReportId": null, + "projectId": null, + "apiDefinitionId": null, + "apiDefinitionNum": null, + "apiDefinitionName": null, + "environmentId": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteTime": null, + "deleteUser": null, + "follow": null, + "method": null, + "path": null, + "environmentName": null, + "createName": null, + "updateName": null, + "deleteName": null, + "tags": + [], + "passRate": null, + "request": + { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "put的mock请求ex2", + "enable": true, + "children": + [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "postProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "assertionConfig": + { + "enableGlobal": true, + "assertions": + [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100005/mock-for-put", + "method": "PUT", + "body": + { + "bodyType": "FORM_DATA", + "noneBody": + {}, + "formDataBody": + { + "formValues": + [ + { + "key": "method", + "value": "put-ex1", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": + { + "formValues": + [] + }, + "jsonBody": + { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": + { + "value": null + }, + "rawBody": + { + "value": null + }, + "binaryBody": + { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": + { + "formValues": + [ + { + "key": "method", + "value": "put-ex1", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": + [], + "rest": + [], + "query": + [], + "otherConfig": + { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": true, + "autoRedirects": false + }, + "authConfig": + { + "authType": "NONE", + "basicAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "modulePath": null, + "moduleId": null, + "protocol": null, + "apiChange": null, + "inconsistentWithApi": null, + "ignoreApiDiff": null, + "ignoreApiChange": null + } + ], + "apiMockList": [ + { + "id": null, + "createTime": null, + "updateTime": null, + "createUser": null, + "name": "空Mock", + "tags": null, + "enable": true, + "expectNum": null, + "projectId": null, + "apiDefinitionId": null, + "statusCode": 0, + "updateUser": null, + "versionId": null, + "mockMatchRule": { + "header": { + "matchRules": [ + { + "key": "headerA", + "value": "Rest_Full_Match1-header-1", + "condition": null, + "description": null + }, + { + "key": "headerB", + "value": "Rest_Full_Match1-header-2", + "condition": null, + "description": null + }, + { + "key": "headerC", + "value": "Rest_Full_Match1-header-3", + "condition": null, + "description": null + } + ], + "matchAll": true + }, + "query": { + "matchRules": null, + "matchAll": false + }, + "rest": { + "matchRules": [ + { + "key": "param1", + "value": "Rest_Full_Match1__query-false_header-true", + "condition": null, + "description": null + }, + { + "key": "param2", + "value": "Rest_Full_Match1-Param2", + "condition": null, + "description": null + } + ], + "matchAll": true + }, + "body": { + "bodyType": null, + "noneBody": null, + "formDataBody": { + "matchRules": null, + "matchAll": false + }, + "wwwFormBody": { + "matchRules": null, + "matchAll": false + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + } + } + }, + "response": { + "statusCode": 444, + "headers": [ + { + "key": "rspHeaderA", + "value": "header-1", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderB", + "value": "header-2", + "enable": false, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderC", + "value": "header-3", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + } + ], + "useApiResponse": true, + "apiResponseId": "1145656756412425", + "body": null, + "delay": null + }, + "createUserName": null, + "apiNum": null, + "apiName": null, + "apiPath": null, + "apiMethod": null, + "protocol": null + }, + { + "id": null, + "createTime": null, + "updateTime": null, + "createUser": null, + "name": "非空Mock", + "tags": null, + "enable": true, + "expectNum": null, + "projectId": null, + "apiDefinitionId": null, + "statusCode": 0, + "updateUser": null, + "versionId": null, + "mockMatchRule": { + "header": { + "matchRules": [ + { + "key": "headerA", + "value": "Rest_Full_Match2-header-1", + "condition": null, + "description": null + }, + { + "key": "headerB", + "value": "Rest_Full_Match2-header-2", + "condition": null, + "description": null + }, + { + "key": "headerC", + "value": "Rest_Full_Match2-header-3", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "query": { + "matchRules": null, + "matchAll": false + }, + "rest": { + "matchRules": [ + { + "key": "param1", + "value": "Rest_Full_Match2__query-false_header-true", + "condition": null, + "description": null + }, + { + "key": "param2", + "value": "Rest_Full_Match2-Param2", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "body": { + "bodyType": null, + "noneBody": null, + "formDataBody": { + "matchRules": null, + "matchAll": false + }, + "wwwFormBody": { + "matchRules": null, + "matchAll": false + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + } + } + }, + "response": { + "statusCode": 200, + "headers": [ + { + "key": "rspHeaderA", + "value": "header-1", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderB", + "value": "header-2", + "enable": false, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderC", + "value": "header-3", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + } + ], + "useApiResponse": false, + "apiResponseId": null, + "body": { + "bodyType": "BINARY", + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "sendAsBody": false, + "description": null, + "file": { + "fileId": "1145673936281619", + "fileName": "mockFileMatch2.txt", + "local": true, + "fileAlias": null, + "delete": false, + "valid": true + } + } + }, + "delay": null + }, + "createUserName": null, + "apiNum": null, + "apiName": null, + "apiPath": null, + "apiMethod": null, + "protocol": null + }, + { + "id": null, + "createTime": null, + "updateTime": null, + "createUser": null, + "name": "非空Mock", + "tags": null, + "enable": true, + "expectNum": null, + "projectId": null, + "apiDefinitionId": null, + "statusCode": 0, + "updateUser": null, + "versionId": null, + "mockMatchRule": { + "header": { + "matchRules": [ + { + "key": "headerA", + "value": "Rest_Full_Match3-header-1", + "condition": null, + "description": null + }, + { + "key": "headerB", + "value": "Rest_Full_Match3-header-2", + "condition": null, + "description": null + }, + { + "key": "headerC", + "value": "Rest_Full_Match3-header-3", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "query": { + "matchRules": null, + "matchAll": false + }, + "rest": { + "matchRules": [ + { + "key": "param1", + "value": "Rest_Full_Match3__query-false_header-true", + "condition": null, + "description": null + }, + { + "key": "param2", + "value": "Rest_Full_Match3-Param2", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "body": { + "bodyType": null, + "noneBody": null, + "formDataBody": { + "matchRules": null, + "matchAll": false + }, + "wwwFormBody": { + "matchRules": null, + "matchAll": false + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + } + } + }, + "response": { + "statusCode": 200, + "headers": [ + { + "key": "rspHeaderA", + "value": "header-1", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderB", + "value": "header-2", + "enable": false, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderC", + "value": "header-3", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + } + ], + "useApiResponse": false, + "apiResponseId": null, + "body": { + "bodyType": "BINARY", + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "sendAsBody": false, + "description": null, + "file": { + "fileId": "1145673936281621", + "fileName": "mockFileMatch3.txt", + "local": true, + "fileAlias": null, + "delete": false, + "valid": true + } + } + }, + "delay": null + }, + "createUserName": null, + "apiNum": null, + "apiName": null, + "apiPath": null, + "apiMethod": null, + "protocol": null + }, + { + "id": null, + "createTime": null, + "updateTime": null, + "createUser": null, + "name": "Mock_POST_Rest_Full_Match4", + "tags": null, + "enable": true, + "expectNum": null, + "projectId": null, + "apiDefinitionId": null, + "statusCode": 0, + "updateUser": null, + "versionId": null, + "mockMatchRule": { + "header": { + "matchRules": [ + { + "key": "headerA", + "value": "Rest_Full_Match4-header-1", + "condition": null, + "description": null + }, + { + "key": "headerB", + "value": "Rest_Full_Match4-header-2", + "condition": null, + "description": null + }, + { + "key": "headerC", + "value": "Rest_Full_Match4-header-3", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "query": { + "matchRules": null, + "matchAll": false + }, + "rest": { + "matchRules": [ + { + "key": "param1", + "value": "Rest_Full_Match4__query-false_header-true", + "condition": null, + "description": null + }, + { + "key": "param2", + "value": "Rest_Full_Match4-Param2", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "body": { + "bodyType": null, + "noneBody": null, + "formDataBody": { + "matchRules": null, + "matchAll": false + }, + "wwwFormBody": { + "matchRules": null, + "matchAll": false + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + } + } + }, + "response": { + "statusCode": 200, + "headers": [ + { + "key": "rspHeaderA", + "value": "header-1", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderB", + "value": "header-2", + "enable": false, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderC", + "value": "header-3", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + } + ], + "useApiResponse": false, + "apiResponseId": null, + "body": { + "bodyType": "BINARY", + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "sendAsBody": false, + "description": null, + "file": { + "fileId": "1145656756412416", + "fileName": "fileMetadata.txt", + "local": true, + "fileAlias": null, + "delete": false, + "valid": true + } + } + }, + "delay": null + }, + "createUserName": null, + "apiNum": null, + "apiName": null, + "apiPath": null, + "apiMethod": null, + "protocol": null + }, + { + "id": null, + "createTime": null, + "updateTime": null, + "createUser": null, + "name": "非空Mock", + "tags": null, + "enable": true, + "expectNum": null, + "projectId": null, + "apiDefinitionId": null, + "statusCode": 0, + "updateUser": null, + "versionId": null, + "mockMatchRule": { + "header": { + "matchRules": null, + "matchAll": false + }, + "query": { + "matchRules": null, + "matchAll": false + }, + "rest": { + "matchRules": [ + { + "key": "param1", + "value": "Header_Full_Match__query-false_header-false", + "condition": null, + "description": null + }, + { + "key": "param2", + "value": "Header_Full_Match-Param2", + "condition": null, + "description": null + } + ], + "matchAll": true + }, + "body": { + "bodyType": null, + "noneBody": null, + "formDataBody": { + "matchRules": null, + "matchAll": false + }, + "wwwFormBody": { + "matchRules": null, + "matchAll": false + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + } + } + }, + "response": { + "statusCode": 201, + "headers": [ + { + "key": "rspHeaderA", + "value": "header-1", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderB", + "value": "header-2", + "enable": false, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderC", + "value": "header-3", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + } + ], + "useApiResponse": false, + "apiResponseId": null, + "body": { + "bodyType": "XML", + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": "Header_Full_Match" + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "sendAsBody": false, + "description": null, + "file": null + } + }, + "delay": null + }, + "createUserName": null, + "apiNum": null, + "apiName": null, + "apiPath": null, + "apiMethod": null, + "protocol": null + }, + { + "id": null, + "createTime": null, + "updateTime": null, + "createUser": null, + "name": "Mock_POST_Header_Half_Match", + "tags": null, + "enable": true, + "expectNum": null, + "projectId": null, + "apiDefinitionId": null, + "statusCode": 0, + "updateUser": null, + "versionId": null, + "mockMatchRule": { + "header": { + "matchRules": null, + "matchAll": false + }, + "query": { + "matchRules": null, + "matchAll": false + }, + "rest": { + "matchRules": [ + { + "key": "param1", + "value": "Header_Half_Match__query-false_header-false", + "condition": null, + "description": null + }, + { + "key": "param2", + "value": "Header_Half_Match-Param2", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "body": { + "bodyType": null, + "noneBody": null, + "formDataBody": { + "matchRules": null, + "matchAll": false + }, + "wwwFormBody": { + "matchRules": null, + "matchAll": false + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + } + } + }, + "response": { + "statusCode": 202, + "headers": [ + { + "key": "rspHeaderA", + "value": "header-1", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderB", + "value": "header-2", + "enable": false, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderC", + "value": "header-3", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + } + ], + "useApiResponse": false, + "apiResponseId": null, + "body": { + "bodyType": "JSON", + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": "{\"inputAge\":123, \"testKeyWord\":\"Header_Half_Match\"}", + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "sendAsBody": false, + "description": null, + "file": null + } + }, + "delay": null + }, + "createUserName": null, + "apiNum": null, + "apiName": null, + "apiPath": null, + "apiMethod": null, + "protocol": null + }, + { + "id": null, + "createTime": null, + "updateTime": null, + "createUser": null, + "name": "Mock_POST_Query_Full_Match", + "tags": null, + "enable": true, + "expectNum": null, + "projectId": null, + "apiDefinitionId": null, + "statusCode": 0, + "updateUser": null, + "versionId": null, + "mockMatchRule": { + "header": { + "matchRules": [ + { + "key": "headerA", + "value": "Query_Full_Match-header-1", + "condition": null, + "description": null + }, + { + "key": "headerB", + "value": "Query_Full_Match-header-2", + "condition": null, + "description": null + }, + { + "key": "headerC", + "value": "Query_Full_Match-header-3", + "condition": null, + "description": null + } + ], + "matchAll": true + }, + "query": { + "matchRules": [ + { + "key": "queryParam1", + "value": "Query_Full_Match_queryParam1Value", + "condition": null, + "description": null + }, + { + "key": "queryParam2", + "value": "Query_Full_Match_queryParam2Value", + "condition": null, + "description": null + }, + { + "key": "queryParam3", + "value": "Query_Full_Match_queryParam3Value", + "condition": null, + "description": null + } + ], + "matchAll": true + }, + "rest": { + "matchRules": [ + { + "key": "param1", + "value": "Query_Full_Match__query-true_header-true", + "condition": null, + "description": null + }, + { + "key": "param2", + "value": "Query_Full_Match-Param2", + "condition": null, + "description": null + } + ], + "matchAll": true + }, + "body": { + "bodyType": null, + "noneBody": null, + "formDataBody": { + "matchRules": null, + "matchAll": false + }, + "wwwFormBody": { + "matchRules": null, + "matchAll": false + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + } + } + }, + "response": { + "statusCode": 203, + "headers": [ + { + "key": "rspHeaderA", + "value": "header-1", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderB", + "value": "header-2", + "enable": false, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderC", + "value": "header-3", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + } + ], + "useApiResponse": false, + "apiResponseId": null, + "body": { + "bodyType": "RAW", + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": "Raw body content:Query_Full_Match" + }, + "binaryBody": { + "sendAsBody": false, + "description": null, + "file": null + } + }, + "delay": null + }, + "createUserName": null, + "apiNum": null, + "apiName": null, + "apiPath": null, + "apiMethod": null, + "protocol": null + } + ] + }, + { + "id": null, + "name": "put的mock请求-另一个", + "protocol": "HTTP", + "method": "PUT", + "path": "/mock-server/100080/100005/mock-for-put", + "status": "PROCESSING", + "num": null, + "tags": + [], + "pos": 8192, + "projectId": null, + "moduleId": null, + "latest": null, + "versionId": null, + "refId": null, + "description": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteUser": null, + "deleteTime": null, + "deleted": null, + "request": + { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "put的mock请求", + "enable": true, + "children": + [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "postProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "assertionConfig": + { + "enableGlobal": true, + "assertions": + [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100005/mock-for-put", + "method": "PUT", + "body": + { + "bodyType": "FORM_DATA", + "noneBody": + {}, + "formDataBody": + { + "formValues": + [ + { + "key": "method", + "value": "put", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": + { + "formValues": + [] + }, + "jsonBody": + { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": + { + "value": null + }, + "rawBody": + { + "value": null + }, + "binaryBody": + { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": + { + "formValues": + [ + { + "key": "method", + "value": "put", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": + [], + "rest": + [], + "query": + [], + "otherConfig": + { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": false, + "autoRedirects": true + }, + "authConfig": + { + "authType": "NONE", + "basicAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "response": + [], + "modulePath": "正常请求的集合", + "apiTestCaseList": + [ + { + "id": null, + "name": "put的mock-copy请求ex", + "priority": "P0", + "num": null, + "status": "PROCESSING", + "lastReportStatus": "PENDING", + "lastReportId": null, + "projectId": null, + "apiDefinitionId": null, + "apiDefinitionNum": null, + "apiDefinitionName": null, + "environmentId": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteTime": null, + "deleteUser": null, + "follow": null, + "method": null, + "path": null, + "environmentName": null, + "createName": null, + "updateName": null, + "deleteName": null, + "tags": + [], + "passRate": null, + "request": + { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "put的mock-copy请求ex", + "enable": true, + "children": + [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "postProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "assertionConfig": + { + "enableGlobal": true, + "assertions": + [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100005/mock-for-put", + "method": "PUT", + "body": + { + "bodyType": "FORM_DATA", + "noneBody": + {}, + "formDataBody": + { + "formValues": + [ + { + "key": "method", + "value": "put", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": + { + "formValues": + [] + }, + "jsonBody": + { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": + { + "value": null + }, + "rawBody": + { + "value": null + }, + "binaryBody": + { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": + { + "formValues": + [ + { + "key": "method", + "value": "put", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": + [], + "rest": + [], + "query": + [], + "otherConfig": + { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": true, + "autoRedirects": false + }, + "authConfig": + { + "authType": "NONE", + "basicAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "modulePath": null, + "moduleId": null, + "protocol": null, + "apiChange": null, + "inconsistentWithApi": null, + "ignoreApiDiff": null, + "ignoreApiChange": null + }, + { + "id": null, + "name": "put的mock-copy请求ex2", + "priority": "P0", + "num": null, + "status": "PROCESSING", + "lastReportStatus": "PENDING", + "lastReportId": null, + "projectId": null, + "apiDefinitionId": null, + "apiDefinitionNum": null, + "apiDefinitionName": null, + "environmentId": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteTime": null, + "deleteUser": null, + "follow": null, + "method": null, + "path": null, + "environmentName": null, + "createName": null, + "updateName": null, + "deleteName": null, + "tags": + [], + "passRate": null, + "request": + { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "put的mock-copy请求ex2", + "enable": true, + "children": + [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "postProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "assertionConfig": + { + "enableGlobal": true, + "assertions": + [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100005/mock-for-put", + "method": "PUT", + "body": + { + "bodyType": "FORM_DATA", + "noneBody": + {}, + "formDataBody": + { + "formValues": + [ + { + "key": "method", + "value": "put", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": + { + "formValues": + [] + }, + "jsonBody": + { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": + { + "value": null + }, + "rawBody": + { + "value": null + }, + "binaryBody": + { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": + { + "formValues": + [ + { + "key": "method", + "value": "put", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": + [], + "rest": + [], + "query": + [], + "otherConfig": + { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": true, + "autoRedirects": false + }, + "authConfig": + { + "authType": "NONE", + "basicAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "modulePath": null, + "moduleId": null, + "protocol": null, + "apiChange": null, + "inconsistentWithApi": null, + "ignoreApiDiff": null, + "ignoreApiChange": null + } + ], + "apiMockList": [ + { + "id": null, + "createTime": null, + "updateTime": null, + "createUser": null, + "name": "非空Mock", + "tags": null, + "enable": true, + "expectNum": null, + "projectId": null, + "apiDefinitionId": null, + "statusCode": 0, + "updateUser": null, + "versionId": null, + "mockMatchRule": { + "header": { + "matchRules": [ + { + "key": "headerA", + "value": "Query_Half_Match-header-1", + "condition": null, + "description": null + }, + { + "key": "headerB", + "value": "Query_Half_Match-header-2", + "condition": null, + "description": null + }, + { + "key": "headerC", + "value": "Query_Half_Match-header-3", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "query": { + "matchRules": [ + { + "key": "queryParam1", + "value": "Query_Half_Match_queryParam1Value", + "condition": null, + "description": null + }, + { + "key": "queryParam2", + "value": "Query_Half_Match_queryParam2Value", + "condition": null, + "description": null + }, + { + "key": "queryParam3", + "value": "Query_Half_Match_queryParam3Value", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "rest": { + "matchRules": [ + { + "key": "param1", + "value": "Query_Half_Match__query-true_header-true", + "condition": null, + "description": null + }, + { + "key": "param2", + "value": "Query_Half_Match-Param2", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "body": { + "bodyType": null, + "noneBody": null, + "formDataBody": { + "matchRules": null, + "matchAll": false + }, + "wwwFormBody": { + "matchRules": null, + "matchAll": false + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + } + } + }, + "response": { + "statusCode": 204, + "headers": [ + { + "key": "rspHeaderA", + "value": "header-1", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderB", + "value": "header-2", + "enable": false, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderC", + "value": "header-3", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + } + ], + "useApiResponse": false, + "apiResponseId": null, + "body": { + "bodyType": "RAW", + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": "Raw body content:Query_Half_Match" + }, + "binaryBody": { + "sendAsBody": false, + "description": null, + "file": null + } + }, + "delay": null + }, + "createUserName": null, + "apiNum": null, + "apiName": null, + "apiPath": null, + "apiMethod": null, + "protocol": null + }, + { + "id": null, + "createTime": null, + "updateTime": null, + "createUser": null, + "name": "Mock_POST_Body-kv_Full_Match", + "tags": null, + "enable": true, + "expectNum": null, + "projectId": null, + "apiDefinitionId": null, + "statusCode": 0, + "updateUser": null, + "versionId": null, + "mockMatchRule": { + "header": { + "matchRules": [ + { + "key": "headerA", + "value": "Body-kv_Full_Match-header-1", + "condition": null, + "description": null + }, + { + "key": "headerB", + "value": "Body-kv_Full_Match-header-2", + "condition": null, + "description": null + }, + { + "key": "headerC", + "value": "Body-kv_Full_Match-header-3", + "condition": null, + "description": null + } + ], + "matchAll": true + }, + "query": { + "matchRules": null, + "matchAll": false + }, + "rest": { + "matchRules": [ + { + "key": "param1", + "value": "Body-kv_Full_Match__query-false_header-true", + "condition": null, + "description": null + }, + { + "key": "param2", + "value": "Body-kv_Full_Match-Param2", + "condition": null, + "description": null + } + ], + "matchAll": true + }, + "body": { + "bodyType": "FORM_DATA", + "noneBody": null, + "formDataBody": { + "matchRules": [ + { + "key": "bodyKvParam1", + "value": "Body-kv_Full_Match_bodyKvParam1", + "condition": null, + "description": null, + "files": null + }, + { + "key": "bodyParam2", + "value": "Body-kv_Full_Match_bodyKvParam2", + "condition": null, + "description": null, + "files": null + }, + { + "key": "bodyParam3", + "value": "Body-kv_Full_Match_bodyKvParam3", + "condition": null, + "description": null, + "files": null + } + ], + "matchAll": true + }, + "wwwFormBody": { + "matchRules": null, + "matchAll": false + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + } + } + }, + "response": { + "statusCode": 204, + "headers": [ + { + "key": "rspHeaderA", + "value": "header-1", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderB", + "value": "header-2", + "enable": false, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderC", + "value": "header-3", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + } + ], + "useApiResponse": false, + "apiResponseId": null, + "body": { + "bodyType": "RAW", + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": "Raw body content:Body-kv_Full_Match" + }, + "binaryBody": { + "sendAsBody": false, + "description": null, + "file": null + } + }, + "delay": null + }, + "createUserName": null, + "apiNum": null, + "apiName": null, + "apiPath": null, + "apiMethod": null, + "protocol": null + }, + { + "id": null, + "createTime": null, + "updateTime": null, + "createUser": null, + "name": "Mock_POST_Body-kv_Full_Match_1", + "tags": null, + "enable": true, + "expectNum": null, + "projectId": null, + "apiDefinitionId": null, + "statusCode": 0, + "updateUser": null, + "versionId": null, + "mockMatchRule": { + "header": { + "matchRules": [ + { + "key": "headerA", + "value": "Body-kv_Full_Match-header-1", + "condition": null, + "description": null + }, + { + "key": "headerB", + "value": "Body-kv_Full_Match-header-2", + "condition": null, + "description": null + }, + { + "key": "headerC", + "value": "Body-kv_Full_Match-header-3", + "condition": null, + "description": null + } + ], + "matchAll": true + }, + "query": { + "matchRules": null, + "matchAll": false + }, + "rest": { + "matchRules": [ + { + "key": "param1", + "value": "Body-kv_Full_Match__query-false_header-true", + "condition": null, + "description": null + }, + { + "key": "param2", + "value": "Body-kv_Full_Match-Param2", + "condition": null, + "description": null + } + ], + "matchAll": true + }, + "body": { + "bodyType": "WWW_FORM", + "noneBody": null, + "formDataBody": { + "matchRules": null, + "matchAll": false + }, + "wwwFormBody": { + "matchRules": [ + { + "key": "bodyKvParam1", + "value": "Body-kv_Full_Match_bodyKvParam1", + "condition": null, + "description": null + }, + { + "key": "bodyParam2", + "value": "Body-kv_Full_Match_bodyKvParam2", + "condition": null, + "description": null + }, + { + "key": "bodyParam3", + "value": "Body-kv_Full_Match_bodyKvParam3", + "condition": null, + "description": null + } + ], + "matchAll": true + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + } + } + }, + "response": { + "statusCode": 204, + "headers": [ + { + "key": "rspHeaderA", + "value": "header-1", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderB", + "value": "header-2", + "enable": false, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderC", + "value": "header-3", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + } + ], + "useApiResponse": false, + "apiResponseId": null, + "body": { + "bodyType": "RAW", + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": "Raw body content:Body-kv_Full_Match" + }, + "binaryBody": { + "sendAsBody": false, + "description": null, + "file": null + } + }, + "delay": null + }, + "createUserName": null, + "apiNum": null, + "apiName": null, + "apiPath": null, + "apiMethod": null, + "protocol": null + }, + { + "id": null, + "createTime": null, + "updateTime": null, + "createUser": null, + "name": "Mock_POST_Body-kv_Half_Match", + "tags": null, + "enable": true, + "expectNum": null, + "projectId": null, + "apiDefinitionId": null, + "statusCode": 0, + "updateUser": null, + "versionId": null, + "mockMatchRule": { + "header": { + "matchRules": [ + { + "key": "headerA", + "value": "Body-kv_Half_Match-header-1", + "condition": null, + "description": null + }, + { + "key": "headerB", + "value": "Body-kv_Half_Match-header-2", + "condition": null, + "description": null + }, + { + "key": "headerC", + "value": "Body-kv_Half_Match-header-3", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "query": { + "matchRules": null, + "matchAll": false + }, + "rest": { + "matchRules": [ + { + "key": "param1", + "value": "Body-kv_Half_Match__query-false_header-true", + "condition": null, + "description": null + }, + { + "key": "param2", + "value": "Body-kv_Half_Match-Param2", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "body": { + "bodyType": "FORM_DATA", + "noneBody": null, + "formDataBody": { + "matchRules": [ + { + "key": "bodyKvParam1", + "value": "Body-kv_Half_Match_bodyKvParam1", + "condition": null, + "description": null, + "files": null + }, + { + "key": "bodyParam2", + "value": "Body-kv_Half_Match_bodyKvParam2", + "condition": null, + "description": null, + "files": null + }, + { + "key": "bodyParam3", + "value": "Body-kv_Half_Match_bodyKvParam3", + "condition": null, + "description": null, + "files": null + } + ], + "matchAll": false + }, + "wwwFormBody": { + "matchRules": null, + "matchAll": false + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + } + } + }, + "response": { + "statusCode": 204, + "headers": [ + { + "key": "rspHeaderA", + "value": "header-1", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderB", + "value": "header-2", + "enable": false, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderC", + "value": "header-3", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + } + ], + "useApiResponse": false, + "apiResponseId": null, + "body": { + "bodyType": "RAW", + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": "Raw body content:Body-kv_Half_Match" + }, + "binaryBody": { + "sendAsBody": false, + "description": null, + "file": null + } + }, + "delay": null + }, + "createUserName": null, + "apiNum": null, + "apiName": null, + "apiPath": null, + "apiMethod": null, + "protocol": null + }, + { + "id": null, + "createTime": null, + "updateTime": null, + "createUser": null, + "name": "Mock_POST_Body-kv-x-www_Half_Match", + "tags": null, + "enable": true, + "expectNum": null, + "projectId": null, + "apiDefinitionId": null, + "statusCode": 0, + "updateUser": null, + "versionId": null, + "mockMatchRule": { + "header": { + "matchRules": [ + { + "key": "headerA", + "value": "Body-kv-x-www_Half_Match-header-1", + "condition": null, + "description": null + }, + { + "key": "headerB", + "value": "Body-kv-x-www_Half_Match-header-2", + "condition": null, + "description": null + }, + { + "key": "headerC", + "value": "Body-kv-x-www_Half_Match-header-3", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "query": { + "matchRules": null, + "matchAll": false + }, + "rest": { + "matchRules": [ + { + "key": "param1", + "value": "Body-kv-x-www_Half_Match__query-false_header-true", + "condition": null, + "description": null + }, + { + "key": "param2", + "value": "Body-kv-x-www_Half_Match-Param2", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "body": { + "bodyType": "FORM_DATA", + "noneBody": null, + "formDataBody": { + "matchRules": [ + { + "key": "bodyKvParam1", + "value": "Body-kv-x-www_Half_Match_bodyKvParam1", + "condition": null, + "description": null, + "files": null + }, + { + "key": "bodyParam2", + "value": "Body-kv-x-www_Half_Match_bodyKvParam2", + "condition": null, + "description": null, + "files": null + }, + { + "key": "bodyParam3", + "value": "Body-kv-x-www_Half_Match_bodyKvParam3", + "condition": null, + "description": null, + "files": null + } + ], + "matchAll": false + }, + "wwwFormBody": { + "matchRules": null, + "matchAll": false + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + } + } + }, + "response": { + "statusCode": 204, + "headers": [ + { + "key": "rspHeaderA", + "value": "header-1", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderB", + "value": "header-2", + "enable": false, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderC", + "value": "header-3", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + } + ], + "useApiResponse": false, + "apiResponseId": null, + "body": { + "bodyType": "RAW", + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": "Raw body content:Body-kv-x-www_Half_Match" + }, + "binaryBody": { + "sendAsBody": false, + "description": null, + "file": null + } + }, + "delay": null + }, + "createUserName": null, + "apiNum": null, + "apiName": null, + "apiPath": null, + "apiMethod": null, + "protocol": null + }, + { + "id": null, + "createTime": null, + "updateTime": null, + "createUser": null, + "name": "Mock_POST_Body-json_Half_Match", + "tags": null, + "enable": true, + "expectNum": null, + "projectId": null, + "apiDefinitionId": null, + "statusCode": 0, + "updateUser": null, + "versionId": null, + "mockMatchRule": { + "header": { + "matchRules": [ + { + "key": "headerA", + "value": "Body-json_Half_Match-header-1", + "condition": null, + "description": null + }, + { + "key": "headerB", + "value": "Body-json_Half_Match-header-2", + "condition": null, + "description": null + }, + { + "key": "headerC", + "value": "Body-json_Half_Match-header-3", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "query": { + "matchRules": null, + "matchAll": false + }, + "rest": { + "matchRules": [ + { + "key": "param1", + "value": "Body-json_Half_Match__query-false_header-true", + "condition": null, + "description": null + }, + { + "key": "param2", + "value": "Body-json_Half_Match-Param2", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "body": { + "bodyType": "JSON", + "noneBody": null, + "formDataBody": { + "matchRules": null, + "matchAll": false + }, + "wwwFormBody": { + "matchRules": null, + "matchAll": false + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": "{\"inputAge\":123}", + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + } + } + }, + "response": { + "statusCode": 204, + "headers": [ + { + "key": "rspHeaderA", + "value": "header-1", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderB", + "value": "header-2", + "enable": false, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderC", + "value": "header-3", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + } + ], + "useApiResponse": false, + "apiResponseId": null, + "body": { + "bodyType": "RAW", + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": "Raw body content:Body-json_Half_Match" + }, + "binaryBody": { + "sendAsBody": false, + "description": null, + "file": null + } + }, + "delay": null + }, + "createUserName": null, + "apiNum": null, + "apiName": null, + "apiPath": null, + "apiMethod": null, + "protocol": null + }, + { + "id": null, + "createTime": null, + "updateTime": null, + "createUser": null, + "name": "Mock_POST_Body-xml_Half_Match", + "tags": null, + "enable": true, + "expectNum": null, + "projectId": null, + "apiDefinitionId": null, + "statusCode": 0, + "updateUser": null, + "versionId": null, + "mockMatchRule": { + "header": { + "matchRules": [ + { + "key": "headerA", + "value": "Body-xml_Half_Match-header-1", + "condition": null, + "description": null + }, + { + "key": "headerB", + "value": "Body-xml_Half_Match-header-2", + "condition": null, + "description": null + }, + { + "key": "headerC", + "value": "Body-xml_Half_Match-header-3", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "query": { + "matchRules": null, + "matchAll": false + }, + "rest": { + "matchRules": [ + { + "key": "param1", + "value": "Body-xml_Half_Match__query-false_header-true", + "condition": null, + "description": null + }, + { + "key": "param2", + "value": "Body-xml_Half_Match-Param2", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "body": { + "bodyType": "XML", + "noneBody": null, + "formDataBody": { + "matchRules": null, + "matchAll": false + }, + "wwwFormBody": { + "matchRules": null, + "matchAll": false + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": "input123" + }, + "rawBody": { + "value": null + }, + "binaryBody": { + "description": null, + "file": null + } + } + }, + "response": { + "statusCode": 204, + "headers": [ + { + "key": "rspHeaderA", + "value": "header-1", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderB", + "value": "header-2", + "enable": false, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderC", + "value": "header-3", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + } + ], + "useApiResponse": false, + "apiResponseId": null, + "body": { + "bodyType": "RAW", + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": "Raw body content:Body-xml_Half_Match" + }, + "binaryBody": { + "sendAsBody": false, + "description": null, + "file": null + } + }, + "delay": null + }, + "createUserName": null, + "apiNum": null, + "apiName": null, + "apiPath": null, + "apiMethod": null, + "protocol": null + }, + { + "id": null, + "createTime": null, + "updateTime": null, + "createUser": null, + "name": "Mock_POST_Body-raw_Half_Match", + "tags": null, + "enable": true, + "expectNum": null, + "projectId": null, + "apiDefinitionId": null, + "statusCode": 0, + "updateUser": null, + "versionId": null, + "mockMatchRule": { + "header": { + "matchRules": [ + { + "key": "headerA", + "value": "body-raw_Half_Match-header-1", + "condition": null, + "description": null + }, + { + "key": "headerB", + "value": "body-raw_Half_Match-header-2", + "condition": null, + "description": null + }, + { + "key": "headerC", + "value": "body-raw_Half_Match-header-3", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "query": { + "matchRules": null, + "matchAll": false + }, + "rest": { + "matchRules": [ + { + "key": "param1", + "value": "body-raw_Half_Match__query-false_header-true", + "condition": null, + "description": null + }, + { + "key": "param2", + "value": "body-raw_Half_Match-Param2", + "condition": null, + "description": null + } + ], + "matchAll": false + }, + "body": { + "bodyType": "RAW", + "noneBody": null, + "formDataBody": { + "matchRules": null, + "matchAll": false + }, + "wwwFormBody": { + "matchRules": null, + "matchAll": false + }, + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": "body-raw_Half_Match_inputRawBody" + }, + "binaryBody": { + "description": null, + "file": null + } + } + }, + "response": { + "statusCode": 204, + "headers": [ + { + "key": "rspHeaderA", + "value": "header-1", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderB", + "value": "header-2", + "enable": false, + "description": null, + "valid": true, + "notBlankValue": true + }, + { + "key": "rspHeaderC", + "value": "header-3", + "enable": true, + "description": null, + "valid": true, + "notBlankValue": true + } + ], + "useApiResponse": false, + "apiResponseId": null, + "body": { + "bodyType": "RAW", + "jsonBody": { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": { + "value": null + }, + "rawBody": { + "value": "Raw body content:body-raw_Half_Match" + }, + "binaryBody": { + "sendAsBody": false, + "description": null, + "file": null + } + }, + "delay": null + }, + "createUserName": null, + "apiNum": null, + "apiName": null, + "apiPath": null, + "apiMethod": null, + "protocol": null + } + ] + }, + { + "id": null, + "name": "post的mock请求", + "protocol": "HTTP", + "method": "POST", + "path": "/mock-server/100080/100004/mock-for-post", + "status": "PROCESSING", + "num": null, + "tags": + [], + "pos": 12288, + "projectId": null, + "moduleId": null, + "latest": null, + "versionId": null, + "refId": null, + "description": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteUser": null, + "deleteTime": null, + "deleted": null, + "request": + { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "post的mock请求", + "enable": true, + "children": + [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "postProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "assertionConfig": + { + "enableGlobal": true, + "assertions": + [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/mock-server/100080/100004/mock-for-post", + "method": "POST", + "body": + { + "bodyType": "FORM_DATA", + "noneBody": + {}, + "formDataBody": + { + "formValues": + [ + { + "key": "method", + "value": "post", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + }, + "wwwFormBody": + { + "formValues": + [] + }, + "jsonBody": + { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": + { + "value": null + }, + "rawBody": + { + "value": null + }, + "binaryBody": + { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.FormDataBody", + "bodyDataByType": + { + "formValues": + [ + { + "key": "method", + "value": "post", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "files": null, + "contentType": null, + "file": false, + "valid": true, + "notBlankValue": true + } + ] + } + }, + "headers": + [], + "rest": + [], + "query": + [], + "otherConfig": + { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": false, + "autoRedirects": true + }, + "authConfig": + { + "authType": "NONE", + "basicAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "response": + [], + "modulePath": "正常请求的集合", + "apiTestCaseList": + [], + "apiMockList": + [] + }, + { + "id": null, + "name": "https://api.tapd.cn/stories?workspace_id=1&id=2", + "protocol": "HTTP", + "method": "GET", + "path": "/stories", + "status": "PROCESSING", + "num": null, + "tags": + [], + "pos": 16384, + "projectId": null, + "moduleId": null, + "latest": null, + "versionId": null, + "refId": null, + "description": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteUser": null, + "deleteTime": null, + "deleted": null, + "request": + { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "https://api.tapd.cn/stories?workspace_id=1&id=2", + "enable": true, + "children": + [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "postProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "assertionConfig": + { + "enableGlobal": true, + "assertions": + [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "/stories", + "method": "GET", + "body": + { + "bodyType": "NONE", + "noneBody": + {}, + "formDataBody": + { + "formValues": + [] + }, + "wwwFormBody": + { + "formValues": + [] + }, + "jsonBody": + { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": + { + "value": null + }, + "rawBody": + { + "value": null + }, + "binaryBody": + { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.NoneBody", + "bodyDataByType": + {} + }, + "headers": + [], + "rest": + [], + "query": + [ + { + "key": "workspace_id", + "value": "1", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "encode": false, + "valid": true, + "notBlankValue": true + }, + { + "key": "id", + "value": "2", + "enable": true, + "description": "", + "paramType": "string", + "required": false, + "minLength": null, + "maxLength": null, + "encode": false, + "valid": true, + "notBlankValue": true + } + ], + "otherConfig": + { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": false, + "autoRedirects": true + }, + "authConfig": + { + "authType": "BASIC", + "basicAuth": + { + "userName": "HIGKLMN", + "password": "ABCDEFG", + "valid": true + }, + "digestAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": true + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "response": + [], + "modulePath": "正常请求的集合", + "apiTestCaseList": + [], + "apiMockList": + [] + } + ] +} \ No newline at end of file diff --git a/backend/services/api-test/src/test/resources/file/import/metersphere/single.json b/backend/services/api-test/src/test/resources/file/import/metersphere/single.json new file mode 100644 index 0000000000..b351ed4b14 --- /dev/null +++ b/backend/services/api-test/src/test/resources/file/import/metersphere/single.json @@ -0,0 +1,156 @@ +{ + "apiDefinitions": + [ + { + "id": null, + "name": "github", + "protocol": "HTTP", + "method": "GET", + "path": "", + "status": "PROCESSING", + "num": null, + "tags": + [], + "pos": 24576, + "projectId": null, + "moduleId": null, + "latest": null, + "versionId": null, + "refId": null, + "description": null, + "createTime": null, + "createUser": null, + "updateTime": null, + "updateUser": null, + "deleteUser": null, + "deleteTime": null, + "deleted": null, + "request": + { + "polymorphicName": "MsHTTPElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": "github", + "enable": true, + "children": + [ + { + "polymorphicName": "MsCommonElement", + "stepId": null, + "resourceId": null, + "projectId": null, + "name": null, + "enable": true, + "children": null, + "parent": null, + "csvIds": null, + "preProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "postProcessorConfig": + { + "enableGlobal": true, + "processors": + [] + }, + "assertionConfig": + { + "enableGlobal": true, + "assertions": + [] + } + } + ], + "parent": null, + "csvIds": null, + "customizeRequest": false, + "customizeRequestEnvEnable": false, + "path": "", + "method": "GET", + "body": + { + "bodyType": "NONE", + "noneBody": + {}, + "formDataBody": + { + "formValues": + [] + }, + "wwwFormBody": + { + "formValues": + [] + }, + "jsonBody": + { + "enableJsonSchema": false, + "jsonValue": null, + "jsonSchema": null + }, + "xmlBody": + { + "value": null + }, + "rawBody": + { + "value": null + }, + "binaryBody": + { + "description": null, + "file": null + }, + "bodyClassByType": "io.metersphere.api.dto.request.http.body.NoneBody", + "bodyDataByType": + {} + }, + "headers": + [], + "rest": + [], + "query": + [], + "otherConfig": + { + "connectTimeout": 60000, + "responseTimeout": 60000, + "certificateAlias": null, + "followRedirects": false, + "autoRedirects": true + }, + "authConfig": + { + "authType": "NONE", + "basicAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "digestAuth": + { + "userName": null, + "password": null, + "valid": false + }, + "httpauthValid": false + }, + "moduleId": null, + "num": null, + "mockNum": null + }, + "response": + [], + "modulePath": "正常请求的集合", + "apiTestCaseList": + [], + "apiMockList": + [] + } + ] +} \ No newline at end of file diff --git a/backend/services/api-test/src/test/resources/file/import/postman/repeatFileDiffApi.json b/backend/services/api-test/src/test/resources/file/import/postman/repeatFileDiffApi.json new file mode 100644 index 0000000000..10f39b090b --- /dev/null +++ b/backend/services/api-test/src/test/resources/file/import/postman/repeatFileDiffApi.json @@ -0,0 +1,300 @@ +{ + "info": { + "_postman_id": "d416135d-5659-4f36-882b-49bad266b8de", + "name": "正常请求的集合", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "15342444" + }, + "item": [ + { + "name": "https://api.tapd.cn/stories?workspace_id=AAA&idddd=BBB Copy", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "password", + "value": "zxdczxczxczcx", + "type": "string" + }, + { + "key": "username", + "value": "basddasda", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "https://api.tapd.cn/stories?workspace_id=AAAAA&idddd=BBBBB", + "protocol": "https", + "host": [ + "api", + "tapd", + "cn" + ], + "path": [ + "stories" + ], + "query": [ + { + "key": "workspace_id", + "value": "AAAAA" + }, + { + "key": "idddd", + "value": "BBBBB" + } + ] + } + }, + "response": [] + }, + { + "name": "post的mock请求 Copy", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "MMM", + "value": "PPP", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100004/mock-for-post", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100004", + "mock-for-post" + ] + } + }, + "response": [] + }, + { + "name": "put的mock请求", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "methoddd", + "value": "pppp", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "response": [ + { + "name": "用于验证名字一样的用例1", + "originalRequest": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "put-ex1", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "用于验证名字一样的用例1", + "originalRequest": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "put-ex1", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + } + ] + }, + { + "name": "put的mock请求 Copy 2", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "nnnn", + "value": "uuuuu", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "response": [ + { + "name": "put的mock-copy请求ex", + "originalRequest": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "putttttttttttt", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "用于验证名字一样的用例1", + "originalRequest": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "put", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + } + ] + } + ] +} \ No newline at end of file diff --git a/backend/services/api-test/src/test/resources/file/import/postman/repeatFileDiffModule.json b/backend/services/api-test/src/test/resources/file/import/postman/repeatFileDiffModule.json new file mode 100644 index 0000000000..6dcac96bbc --- /dev/null +++ b/backend/services/api-test/src/test/resources/file/import/postman/repeatFileDiffModule.json @@ -0,0 +1,131 @@ +{ + "info": { + "_postman_id": "eb491590-d146-4dac-9c80-e4c79908fa65", + "name": "repeatFileDiffModule", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "15342444" + }, + "item": [ + { + "name": "firstlevel", + "item": [ + { + "name": "secondlevel", + "item": [ + { + "name": "https://api.tapd.cn/stories?workspace_id=AAAAA&idddd=BBBBB Copy 2", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "password", + "value": "metersphere", + "type": "string" + }, + { + "key": "username", + "value": "metersphere", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "https://api.tapd.cn/stories?workspace_id=AAAAA&idddd=BBBBB", + "protocol": "https", + "host": [ + "api", + "tapd", + "cn" + ], + "path": [ + "stories" + ], + "query": [ + { + "key": "workspace_id", + "value": "AAAAA" + }, + { + "key": "idddd", + "value": "BBBBB" + } + ] + } + }, + "response": [] + }, + { + "name": "post的mock请求", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "MMM", + "value": "PPP", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100004/mock-for-post", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100004", + "mock-for-post" + ] + } + }, + "response": [] + }, + { + "name": "put的mock请求", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "methoddd", + "value": "pppp", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "response": [] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/backend/services/api-test/src/test/resources/file/import/postman/simple.json b/backend/services/api-test/src/test/resources/file/import/postman/simple.json new file mode 100644 index 0000000000..3a6856a9fa --- /dev/null +++ b/backend/services/api-test/src/test/resources/file/import/postman/simple.json @@ -0,0 +1,300 @@ +{ + "info": { + "_postman_id": "5cf79f3a-bc44-467e-91a0-9aed51daf23c", + "name": "正常请求的集合", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "15342444" + }, + "item": [ + { + "name": "https://api.tapd.cn/stories?workspace_id=1&id=2", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "password", + "value": "ABCDEFG", + "type": "string" + }, + { + "key": "username", + "value": "HIGKLMN", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "https://api.tapd.cn/stories?workspace_id=1&id=2", + "protocol": "https", + "host": [ + "api", + "tapd", + "cn" + ], + "path": [ + "stories" + ], + "query": [ + { + "key": "workspace_id", + "value": "1" + }, + { + "key": "id", + "value": "2" + } + ] + } + }, + "response": [] + }, + { + "name": "post的mock请求", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "post", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100004/mock-for-post", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100004", + "mock-for-post" + ] + } + }, + "response": [] + }, + { + "name": "put的mock请求", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "put", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "response": [ + { + "name": "put的mock请求ex1", + "originalRequest": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "put-ex1", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "put的mock请求ex2", + "originalRequest": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "put-ex1", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + } + ] + }, + { + "name": "put的mock请求 Copy", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "put", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "response": [ + { + "name": "put的mock-copy请求ex", + "originalRequest": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "put", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "put的mock-copy请求ex2", + "originalRequest": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "put", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + } + ] + } + ] +} \ No newline at end of file diff --git a/backend/services/api-test/src/test/resources/file/import/postman/single.json b/backend/services/api-test/src/test/resources/file/import/postman/single.json new file mode 100644 index 0000000000..7581eaed71 --- /dev/null +++ b/backend/services/api-test/src/test/resources/file/import/postman/single.json @@ -0,0 +1,27 @@ +{ + "info": { + "_postman_id": "1f4931b9-f142-4c6a-8041-c41d75f84990", + "name": "single", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "15342444" + }, + "item": [ + { + "name": "github", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://www.github.com", + "protocol": "https", + "host": [ + "www", + "github", + "com" + ] + } + }, + "response": [] + } + ] +} \ No newline at end of file diff --git a/backend/services/api-test/src/test/resources/file/postman_collection.json b/backend/services/api-test/src/test/resources/file/postman_collection.json new file mode 100644 index 0000000000..cbfbce8dc9 --- /dev/null +++ b/backend/services/api-test/src/test/resources/file/postman_collection.json @@ -0,0 +1,300 @@ +{ + "info": { + "_postman_id": "5cf79f3a-bc44-467e-91a0-9aed51daf23c", + "name": "正常请求的集合", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "15342444" + }, + "item": [ + { + "name": "https://api.tapd.cn/stories?workspace_id=55049933&id=1155049933001012963", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "password", + "value": "9CD9AB02-7497-0B85-2C4F-45CC3EA763F8", + "type": "string" + }, + { + "key": "username", + "value": "oOjrikkm", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "https://api.tapd.cn/stories?workspace_id=55049933&id=1155049933001012963", + "protocol": "https", + "host": [ + "api", + "tapd", + "cn" + ], + "path": [ + "stories" + ], + "query": [ + { + "key": "workspace_id", + "value": "55049933" + }, + { + "key": "id", + "value": "1155049933001012963" + } + ] + } + }, + "response": [] + }, + { + "name": "post的mock请求", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "post", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100004/mock-for-post", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100004", + "mock-for-post" + ] + } + }, + "response": [] + }, + { + "name": "put的mock请求", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "put", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "response": [ + { + "name": "put的mock请求ex1", + "originalRequest": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "put-ex1", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "put的mock请求ex2", + "originalRequest": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "put-ex1", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + } + ] + }, + { + "name": "put的mock请求 Copy", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "put", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "response": [ + { + "name": "put的mock-copy请求ex", + "originalRequest": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "put", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "put的mock-copy请求ex2", + "originalRequest": { + "method": "PUT", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "put", + "type": "text" + } + ] + }, + "url": { + "raw": "https://ms-v3.fit2cloud.com/mock-server/100080/100005/mock-for-put", + "protocol": "https", + "host": [ + "ms-v3", + "fit2cloud", + "com" + ], + "path": [ + "mock-server", + "100080", + "100005", + "mock-for-put" + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + } + ] + } + ] +} \ No newline at end of file diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/utils/TreeNodeParseUtils.java b/backend/services/system-setting/src/main/java/io/metersphere/system/utils/TreeNodeParseUtils.java index f2cbbe96c5..0daee5a5a3 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/utils/TreeNodeParseUtils.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/utils/TreeNodeParseUtils.java @@ -3,6 +3,8 @@ package io.metersphere.system.utils; import io.metersphere.project.domain.Project; import io.metersphere.system.domain.Organization; import io.metersphere.system.dto.sdk.BaseTreeNode; +import io.metersphere.system.uid.IDGenerator; +import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.List; @@ -25,4 +27,53 @@ public class TreeNodeParseUtils { } return returnList; } + + + // nodePath需要以"/"开头 + public static List getInsertNodeByPath(Map modulePathMap, String nodePath) { + //解析modulePath 格式为/a/b/c + String[] split = nodePath.split("/"); + //一层一层的创建 + List insertList = new ArrayList<>(); + + //因为nodePath是以/开头的,所以split[0]为空,从1开始 + for (int i = 1; i < split.length; i++) { + String modulePath = StringUtils.join(split, "/", 1, i + 1); + String path = StringUtils.join("/", modulePath); + BaseTreeNode baseTreeNode = modulePathMap.get(path); + if (baseTreeNode == null) { + //创建模块 + BaseTreeNode module = new BaseTreeNode(); + module.setId(IDGenerator.nextStr()); + module.setName(split[i]); + if (i != 1) { + String parentPath = path.substring(0, path.lastIndexOf("/" + split[i])); + module.setParentId(modulePathMap.get(parentPath).getId()); + } + module.setPath(path); + insertList.add(module); + modulePathMap.put(path, module); + } + } + return insertList; + } + + public static String genFullModulePath(String selectModulePath, String modulePath) { + String firstPath = selectModulePath; + String lathPath = modulePath; + if (!StringUtils.startsWith(firstPath, "/")) { + firstPath = "/" + firstPath; + } + if (StringUtils.endsWith(firstPath, "/")) { + firstPath = firstPath.substring(0, firstPath.length() - 1); + } + + if (!StringUtils.startsWith(lathPath, "/")) { + lathPath = "/" + lathPath; + } + if (StringUtils.endsWith(lathPath, "/")) { + lathPath = lathPath.substring(0, firstPath.length() - 1); + } + return firstPath + lathPath; + } }