From 0f5da509cff3e35baeed5cf8b80f314fc437ce2e Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 25 Dec 2020 11:28:16 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E5=8F=96=E6=B6=88=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProjectController.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/backend/src/main/java/io/metersphere/controller/ProjectController.java b/backend/src/main/java/io/metersphere/controller/ProjectController.java index 42df9e91b6..edf0d20024 100644 --- a/backend/src/main/java/io/metersphere/controller/ProjectController.java +++ b/backend/src/main/java/io/metersphere/controller/ProjectController.java @@ -16,7 +16,6 @@ import org.apache.shiro.authz.annotation.RequiresRoles; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import java.util.ArrayList; import java.util.List; @RestController @@ -29,20 +28,18 @@ public class ProjectController { @GetMapping("/listAll") public List listAll() { -// String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId(); -// ProjectRequest request = new ProjectRequest(); -// request.setWorkspaceId(currentWorkspaceId); -// return projectService.getProjectList(request); - return new ArrayList<>(); + String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId(); + ProjectRequest request = new ProjectRequest(); + request.setWorkspaceId(currentWorkspaceId); + return projectService.getProjectList(request); } /*jenkins项目列表*/ @GetMapping("/listAll/{workspaceId}") public List jlistAll(@PathVariable String workspaceId) { -// ProjectRequest request = new ProjectRequest(); -// request.setWorkspaceId(workspaceId); -// return projectService.getProjectList(request); - return new ArrayList<>(); + ProjectRequest request = new ProjectRequest(); + request.setWorkspaceId(workspaceId); + return projectService.getProjectList(request); } @GetMapping("/recent/{count}") From cd3e68ab4d0594d2b78c76b755b5fd48318b8168 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 25 Dec 2020 12:07:06 +0800 Subject: [PATCH 2/4] =?UTF-8?q?refactor:=20=E6=8E=A5=E5=8F=A3=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=88=B0=E9=80=89=E4=B8=AD=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/api/service/ApiDefinitionService.java | 3 ++- .../components/api/definition/components/module/ApiModule.vue | 1 + .../api/definition/components/module/ApiModuleHeader.vue | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index 06ed0e92da..c5e699704d 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -369,7 +369,7 @@ public class ApiDefinitionService { return apiImport; } - private void importApiTest(ApiTestImportRequest importRequest, ApiDefinitionImport apiImport) { + private void importApiTest(ApiTestImportRequest request, ApiDefinitionImport apiImport) { SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH); ApiDefinitionMapper batchMapper = sqlSession.getMapper(ApiDefinitionMapper.class); List data = apiImport.getData(); @@ -378,6 +378,7 @@ public class ApiDefinitionService { if (item.getName().length() > 255) { item.setName(item.getName().substring(0, 255)); } + item.setModuleId(request.getModuleId()); createTest(item, batchMapper); if (i % 300 == 0) { sqlSession.flushStatements(); diff --git a/frontend/src/business/components/api/definition/components/module/ApiModule.vue b/frontend/src/business/components/api/definition/components/module/ApiModule.vue index 3fa76942ec..fb00c0da36 100644 --- a/frontend/src/business/components/api/definition/components/module/ApiModule.vue +++ b/frontend/src/business/components/api/definition/components/module/ApiModule.vue @@ -21,6 +21,7 @@ :is-read-only="isReadOnly" @exportAPI="exportAPI" @saveAsEdit="saveAsEdit" + @refreshTable="$emit('refreshTable')" @refresh="refresh" @debug="debug"/> diff --git a/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue b/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue index c799cefb4c..19ef14456d 100644 --- a/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue +++ b/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue @@ -33,7 +33,7 @@ @saveAsEdit="saveAsEdit" @refresh="refresh" ref="basisApi"/> - + From 8db039e1b798b3709979d633df46ae9049fdb463 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Fri, 25 Dec 2020 13:30:35 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Drps=20index=20?= =?UTF-8?q?=E8=B6=8A=E7=95=8C=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xml/reader/jmx/JmeterDocumentParser.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java b/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java index c81ceb1b0a..fe1f20966f 100644 --- a/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java +++ b/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java @@ -878,6 +878,24 @@ public class JmeterDocumentParser implements DocumentParser { } private void processVariableThroughputTimer(Element variableThroughputTimer) { + Object durations = context.getProperty("duration"); + Integer duration; + if (durations instanceof List) { + Object o = ((List) durations).get(0); + duration = (Integer) o; + ((List) durations).remove(0); + } else { + duration = (Integer) durations; + } + Object rpsLimits = context.getProperty("rpsLimit"); + String rpsLimit; + if (rpsLimits instanceof List) { + Object o = ((List) rpsLimits).get(0); + ((List) rpsLimits).remove(0); + rpsLimit = o.toString(); + } else { + rpsLimit = rpsLimits.toString(); + } if (variableThroughputTimer.getChildNodes().getLength() > 0) { final NodeList childNodes = variableThroughputTimer.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { @@ -903,27 +921,9 @@ public class JmeterDocumentParser implements DocumentParser { stringPropCount++; } else { stringPropCount = 0; - Object durations = context.getProperty("duration");// 传入的是分钟数, 需要转化成秒数 - Integer duration; - if (durations instanceof List) { - Object o = ((List) durations).get(0); - duration = (Integer) o; - ((List) durations).remove(0); - } else { - duration = (Integer) durations; - } prop.getFirstChild().setNodeValue(String.valueOf(duration)); continue; } - Object rpsLimits = context.getProperty("rpsLimit"); - String rpsLimit; - if (rpsLimits instanceof List) { - Object o = ((List) rpsLimits).get(0); - ((List) rpsLimits).remove(0); - rpsLimit = o.toString(); - } else { - rpsLimit = rpsLimits.toString(); - } prop.getFirstChild().setNodeValue(rpsLimit); } } From 6e3139d24ff0dc7da2c00c7279a2c0ecb17f9853 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Fri, 25 Dec 2020 13:31:00 +0800 Subject: [PATCH 4/4] chore: Sync --- backend/src/main/java/io/metersphere/xpack | 2 +- frontend/src/business/components/xpack | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index 9f4a9bbf46..79343a2763 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit 9f4a9bbf46fc1333dbcccea21f83e27e3ec10b1f +Subproject commit 79343a2763b014355f91fc21b2356a95ae437973 diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 010ad7a5f0..8cda5c873c 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 010ad7a5f072a5e9d368c756a2473bbd20781433 +Subproject commit 8cda5c873cd9985c97adb34efacf507167fa4182