接口测试结果刷新
This commit is contained in:
commit
6f4d91102f
|
@ -20,6 +20,7 @@ import org.springframework.util.CollectionUtils;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
@ -122,7 +123,16 @@ public class APITestService {
|
|||
apiTestMapper.updateByPrimaryKeySelective(apiTest);
|
||||
}
|
||||
|
||||
private void checkNameExist(SaveAPITestRequest request) {
|
||||
ApiTestExample example = new ApiTestExample();
|
||||
example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId()).andIdNotEqualTo(request.getId());
|
||||
if (apiTestMapper.countByExample(example) > 0) {
|
||||
MSException.throwException(Translator.get("load_test_already_exists"));
|
||||
}
|
||||
}
|
||||
|
||||
private ApiTestWithBLOBs updateTest(SaveAPITestRequest request) {
|
||||
checkNameExist(request);
|
||||
final ApiTestWithBLOBs test = new ApiTestWithBLOBs();
|
||||
test.setId(request.getId());
|
||||
test.setName(request.getName());
|
||||
|
@ -130,31 +140,12 @@ public class APITestService {
|
|||
test.setScenarioDefinition(request.getScenarioDefinition());
|
||||
test.setUpdateTime(System.currentTimeMillis());
|
||||
test.setStatus(APITestStatus.Saved.name());
|
||||
checkApiTestExist(test);
|
||||
apiTestMapper.updateByPrimaryKeySelective(test);
|
||||
return test;
|
||||
}
|
||||
|
||||
private void checkApiTestExist(ApiTest apiTest) {
|
||||
if (apiTest.getName() != null) {
|
||||
ApiTestExample example = new ApiTestExample();
|
||||
example.createCriteria()
|
||||
.andNameEqualTo(apiTest.getName())
|
||||
.andProjectIdEqualTo(apiTest.getProjectId())
|
||||
.andIdNotEqualTo(apiTest.getId());
|
||||
if (apiTestMapper.selectByExample(example).size() > 0) {
|
||||
MSException.throwException(Translator.get("api_test_name_already_exists"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ApiTestWithBLOBs createTest(SaveAPITestRequest request) {
|
||||
ApiTestExample example = new ApiTestExample();
|
||||
example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId());
|
||||
if (apiTestMapper.countByExample(example) > 0) {
|
||||
MSException.throwException(Translator.get("load_test_already_exists"));
|
||||
}
|
||||
|
||||
checkNameExist(request);
|
||||
final ApiTestWithBLOBs test = new ApiTestWithBLOBs();
|
||||
test.setId(request.getId());
|
||||
test.setName(request.getName());
|
||||
|
|
|
@ -347,6 +347,7 @@
|
|||
testTabChange(data) {
|
||||
if (this.testCase.type == 'performance' && data.paneName == 'result') {
|
||||
this.$refs.performanceTestResult.checkReportStatus();
|
||||
this.$refs.performanceTestResult.init();
|
||||
}
|
||||
},
|
||||
saveReport(reportId) {
|
||||
|
|
Loading…
Reference in New Issue