diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/dto/BaseCase.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/dto/BaseCase.java new file mode 100644 index 0000000000..9c65bc240e --- /dev/null +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/dto/BaseCase.java @@ -0,0 +1,12 @@ +package io.metersphere.dto; + +import lombok.Data; + +@Data +public class BaseCase { + private String id; + private String name; + private String projectId; + private String versionName; + private String type; +} diff --git a/performance-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java b/performance-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java index 927dea575a..cc49af255a 100644 --- a/performance-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java +++ b/performance-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java @@ -2,6 +2,7 @@ package io.metersphere.base.mapper.ext; import io.metersphere.base.domain.FileMetadata; import io.metersphere.base.domain.LoadTest; +import io.metersphere.dto.BaseCase; import io.metersphere.dto.LoadCaseCountChartResult; import io.metersphere.dto.LoadTestDTO; import io.metersphere.plan.request.LoadCaseRequest; @@ -49,4 +50,6 @@ public interface ExtLoadTestMapper { List countByRequest(LoadCaseCountRequest request); List relevanceLoadList(@Param("request") LoadCaseRequest request); + + List selectBaseCaseByProjectId(@Param("projectId") String projectId); } diff --git a/performance-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml b/performance-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml index 3a1ace0c54..5fac1b8493 100644 --- a/performance-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml +++ b/performance-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml @@ -630,4 +630,15 @@ + + diff --git a/performance-test/backend/src/main/java/io/metersphere/controller/PerformanceTestController.java b/performance-test/backend/src/main/java/io/metersphere/controller/PerformanceTestController.java index 039fcbad1c..bb2072607f 100644 --- a/performance-test/backend/src/main/java/io/metersphere/controller/PerformanceTestController.java +++ b/performance-test/backend/src/main/java/io/metersphere/controller/PerformanceTestController.java @@ -324,4 +324,10 @@ public class PerformanceTestController { public List getLoadCaseByIds(@RequestBody List ids) { return performanceTestService.getLoadCaseByIds(ids); } + + @GetMapping("/get-base-case/{projectId}") + @RequiresPermissions("PROJECT_PERFORMANCE_TEST:READ") + public List getBaseCaseByProjectId(@PathVariable String projectId) { + return performanceTestService.getBaseCaseByProjectId(projectId); + } } diff --git a/performance-test/backend/src/main/java/io/metersphere/service/PerformanceTestService.java b/performance-test/backend/src/main/java/io/metersphere/service/PerformanceTestService.java index 8b22cead23..65f061d488 100644 --- a/performance-test/backend/src/main/java/io/metersphere/service/PerformanceTestService.java +++ b/performance-test/backend/src/main/java/io/metersphere/service/PerformanceTestService.java @@ -1014,4 +1014,8 @@ public class PerformanceTestService { MSException.throwException(errorMessage + Translator.get("project_file_in_use")); } } + + public List getBaseCaseByProjectId(String projectId) { + return extLoadTestMapper.selectBaseCaseByProjectId(projectId); + } }