From 61ce70c3f6f8bd78dafb311187243c87b5938fa6 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Fri, 18 Jun 2021 21:53:02 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BD=BF=E7=94=A8=E5=89=8D?= =?UTF-8?q?=E5=8F=B0=E4=BC=A0=E5=85=A5=E7=9A=84=20project=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/ApiAutomationController.java | 6 ------ .../io/metersphere/controller/ProjectController.java | 6 ------ .../controller/PerformanceReportController.java | 12 ------------ .../controller/PerformanceTestController.java | 6 ------ 4 files changed, 30 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java index 968ddef8bb..aa102246df 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java @@ -46,12 +46,6 @@ public class ApiAutomationController { @PostMapping("/list/{goPage}/{pageSize}") @RequiresPermissions("PROJECT_API_SCENARIO:READ") public Pager> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiScenarioRequest request) { - if (StringUtils.isBlank(request.getProjectId())) { - List sourceIds = SessionUtils.getUser().getUserGroups().stream().map(UserGroup::getSourceId).collect(Collectors.toList()); - request.setFilters(new HashMap>() {{ - put("project_id", sourceIds); - }}); - } Page page = PageHelper.startPage(goPage, pageSize, true); return PageUtils.setPageInfo(page, apiAutomationService.list(request)); diff --git a/backend/src/main/java/io/metersphere/controller/ProjectController.java b/backend/src/main/java/io/metersphere/controller/ProjectController.java index 2f94268875..7e07e6069a 100644 --- a/backend/src/main/java/io/metersphere/controller/ProjectController.java +++ b/backend/src/main/java/io/metersphere/controller/ProjectController.java @@ -87,12 +87,6 @@ public class ProjectController { @PostMapping("/list/{goPage}/{pageSize}") public Pager> getProjectList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ProjectRequest request) { - if (StringUtils.isBlank(request.getProjectId())) { - List sourceIds = SessionUtils.getUser().getUserGroups().stream().map(UserGroup::getSourceId).collect(Collectors.toList()); - request.setFilters(new HashMap>() {{ - put("workspace_id", sourceIds); - }}); - } Page page = PageHelper.startPage(goPage, pageSize, true); return PageUtils.setPageInfo(page, projectService.getProjectList(request)); } diff --git a/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java b/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java index e0e1a2b6ab..3e6fc2b9e4 100644 --- a/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java +++ b/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java @@ -39,12 +39,6 @@ public class PerformanceReportController { @PostMapping("/recent/{count}") @RequiresPermissions("PROJECT_PERFORMANCE_REPORT:READ") public List recentProjects(@PathVariable int count, @RequestBody ReportRequest request) { - if (StringUtils.isBlank(request.getProjectId())) { - List sourceIds = SessionUtils.getUser().getUserGroups().stream().map(UserGroup::getSourceId).collect(Collectors.toList()); - request.setFilters(new HashMap>() {{ - put("project_id", sourceIds); - }}); - } // 最近 `count` 个项目 PageHelper.startPage(1, count); return performanceReportService.getRecentReportList(request); @@ -53,12 +47,6 @@ public class PerformanceReportController { @PostMapping("/list/all/{goPage}/{pageSize}") @RequiresPermissions("PROJECT_PERFORMANCE_REPORT:READ") public Pager> getReportList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ReportRequest request) { - if (StringUtils.isBlank(request.getProjectId())) { - List sourceIds = SessionUtils.getUser().getUserGroups().stream().map(UserGroup::getSourceId).collect(Collectors.toList()); - request.setFilters(new HashMap>() {{ - put("project_id", sourceIds); - }}); - } Page page = PageHelper.startPage(goPage, pageSize, true); return PageUtils.setPageInfo(page, performanceReportService.getReportList(request)); } diff --git a/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java b/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java index 5497a18585..17cba5295d 100644 --- a/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java +++ b/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java @@ -56,12 +56,6 @@ public class PerformanceTestController { @PostMapping("/list/{goPage}/{pageSize}") @RequiresPermissions("PROJECT_PERFORMANCE_TEST:READ") public Pager> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryTestPlanRequest request) { - if (StringUtils.isBlank(request.getProjectId())) { - List sourceIds = SessionUtils.getUser().getUserGroups().stream().map(UserGroup::getSourceId).collect(Collectors.toList()); - request.setFilters(new HashMap>() {{ - put("project_id", sourceIds); - }}); - } Page page = PageHelper.startPage(goPage, pageSize, true); return PageUtils.setPageInfo(page, performanceTestService.list(request)); }