This commit is contained in:
fit2-zhao 2020-12-25 13:57:54 +08:00
commit 719bda0ff7
7 changed files with 31 additions and 32 deletions

View File

@ -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<ApiDefinitionResult> 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();

View File

@ -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<ProjectDTO> 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<ProjectDTO> 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}")

View File

@ -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);
}
}

@ -1 +1 @@
Subproject commit 9f4a9bbf46fc1333dbcccea21f83e27e3ec10b1f
Subproject commit 79343a2763b014355f91fc21b2356a95ae437973

View File

@ -21,6 +21,7 @@
:is-read-only="isReadOnly"
@exportAPI="exportAPI"
@saveAsEdit="saveAsEdit"
@refreshTable="$emit('refreshTable')"
@refresh="refresh"
@debug="debug"/>
</template>

View File

@ -33,7 +33,7 @@
@saveAsEdit="saveAsEdit"
@refresh="refresh"
ref="basisApi"/>
<api-import ref="apiImport" @refresh="refresh"/>
<api-import ref="apiImport" @refresh="$emit('refreshTable')"/>
</div>
</template>

@ -1 +1 @@
Subproject commit 010ad7a5f072a5e9d368c756a2473bbd20781433
Subproject commit 8cda5c873cd9985c97adb34efacf507167fa4182