From 32a82ac55d5f7ba3825cf1f81e9b4defca21e7e8 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Thu, 13 Oct 2022 14:58:12 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=8B=E6=89=80=E6=9C=89=E7=9A=84=E7=94=A8?= =?UTF-8?q?=E4=BE=8B(=E5=B8=A6=E7=89=88=E6=9C=AC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/io/metersphere/dto/BaseCase.java | 12 ++++++++++++ .../base/mapper/ext/ExtLoadTestMapper.java | 3 +++ .../base/mapper/ext/ExtLoadTestMapper.xml | 11 +++++++++++ .../controller/PerformanceTestController.java | 6 ++++++ .../metersphere/service/PerformanceTestService.java | 4 ++++ 5 files changed, 36 insertions(+) create mode 100644 framework/sdk-parent/sdk/src/main/java/io/metersphere/dto/BaseCase.java 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); + } }