From 20e365618c107757914e0f96005bef1f13edd187 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Fri, 14 Jun 2024 11:31:05 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):?= =?UTF-8?q?=20=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E5=80=BC&sql=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/plan/controller/TestPlanApiCaseController.java | 2 +- .../plan/controller/TestPlanApiScenarioController.java | 2 +- .../metersphere/plan/dto/response/TestPlanDetailResponse.java | 3 +++ .../metersphere/plan/mapper/ExtTestPlanApiScenarioMapper.xml | 2 +- .../main/java/io/metersphere/plan/service/TestPlanService.java | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiCaseController.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiCaseController.java index ca43ddee3a..fa07d5ae96 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiCaseController.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiCaseController.java @@ -66,7 +66,7 @@ public class TestPlanApiCaseController { @CheckOwner(resourceId = "#request.getTestPlanId()", resourceType = "test_plan") public Pager> page(@Validated @RequestBody TestPlanApiCaseRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), - StringUtils.isNotBlank(request.getSortString("id")) ? request.getSortString("id") : "create_time desc"); + StringUtils.isNotBlank(request.getSortString("id")) ? request.getSortString("id") : "t.pos asc"); return PageUtils.setPageInfo(page, testPlanApiCaseService.hasRelateApiCaseList(request, false)); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiScenarioController.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiScenarioController.java index 1e3d1f130b..159d2f18be 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiScenarioController.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiScenarioController.java @@ -55,7 +55,7 @@ public class TestPlanApiScenarioController { @CheckOwner(resourceId = "#request.getTestPlanId()", resourceType = "test_plan") public Pager> page(@Validated @RequestBody TestPlanApiScenarioRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), - StringUtils.isNotBlank(request.getSortString("id")) ? request.getSortString("id") : "create_time desc"); + StringUtils.isNotBlank(request.getSortString("id")) ? request.getSortString("id") : "test_plan_api_scenario.pos asc"); return PageUtils.setPageInfo(page, testPlanApiScenarioService.hasRelateApiScenarioList(request, false)); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanDetailResponse.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanDetailResponse.java index 106161a348..32499ba1b1 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanDetailResponse.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanDetailResponse.java @@ -63,4 +63,7 @@ public class TestPlanDetailResponse extends TestPlanStatisticsResponse implement @Schema(description = "关注标识") private Boolean followFlag; + + @Schema(description = "类型") + private String type; } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiScenarioMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiScenarioMapper.xml index fee822cf1f..e2b5b4d9b9 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiScenarioMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiScenarioMapper.xml @@ -126,7 +126,7 @@ - and t.test_plan_collection_id = #{request.collectionId} + and test_plan_api_scenario.test_plan_collection_id = #{request.collectionId} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanService.java index 452f0e1cda..79bc2b0475 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanService.java @@ -473,6 +473,7 @@ public class TestPlanService extends TestPlanBaseUtilsService { response.setModuleId(testPlan.getModuleId()); response.setModuleName(moduleName); response.setDescription(testPlan.getDescription()); + response.setType(testPlan.getType()); if (StringUtils.equalsIgnoreCase(testPlan.getType(), TestPlanConstants.TEST_PLAN_TYPE_PLAN)) { //计划的 其他参数 getGroupName(response, testPlan);