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/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}") 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); } } 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/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"/> - + 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