From 57b59bda49e9ef9e772c144e97855ab10cb56cc3 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 24 Apr 2024 16:37:00 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E6=8E=A5=E5=8F=A3=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/definition/ApiDefinitionController.java | 2 +- .../api/controller/definition/ApiTestCaseController.java | 4 ++-- .../api/controller/scenario/ApiScenarioController.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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 9750418289..62df5cc1ae 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 @@ -131,7 +131,7 @@ public class ApiDefinitionController { @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") public Pager> getPage(@Validated @RequestBody ApiDefinitionPageRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), - StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : request.getDeleted() ? "delete_time desc" : "pos desc"); + StringUtils.isNotBlank(request.getSortString("id")) ? request.getSortString("id") : request.getDeleted() ? "delete_time desc, id desc" : "pos desc, id desc"); return PageUtils.setPageInfo(page, apiDefinitionService.getApiDefinitionPage(request, SessionUtils.getUserId())); } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiTestCaseController.java b/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiTestCaseController.java index 13c6808a68..d28c8946a9 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiTestCaseController.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiTestCaseController.java @@ -155,7 +155,7 @@ public class ApiTestCaseController { @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") public Pager> page(@Validated @RequestBody ApiTestCasePageRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), - StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "pos desc"); + StringUtils.isNotBlank(request.getSortString("id")) ? request.getSortString("id") : "pos desc, id desc"); return PageUtils.setPageInfo(page, apiTestCaseService.page(request, false)); } @@ -197,7 +197,7 @@ public class ApiTestCaseController { @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") public Pager> pageTrash(@Validated @RequestBody ApiTestCasePageRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), - StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "delete_time desc"); + StringUtils.isNotBlank(request.getSortString("id")) ? request.getSortString("id") : "delete_time desc, id desc"); return PageUtils.setPageInfo(page, apiTestCaseService.page(request, true)); } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/controller/scenario/ApiScenarioController.java b/backend/services/api-test/src/main/java/io/metersphere/api/controller/scenario/ApiScenarioController.java index a0e4ef8928..3f5bee9a80 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/controller/scenario/ApiScenarioController.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/controller/scenario/ApiScenarioController.java @@ -68,7 +68,7 @@ public class ApiScenarioController { @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") public Pager> getTrashPage(@Validated @RequestBody ApiScenarioPageRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), - StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "delete_time desc"); + StringUtils.isNotBlank(request.getSortString("id")) ? request.getSortString("id") : "delete_time desc, id desc"); request.setDeleted(true); return PageUtils.setPageInfo(page, apiScenarioService.getScenarioPage(request)); }