parent
35ab1c1f47
commit
cf9615a317
|
@ -529,17 +529,25 @@ public class ApiDefinitionImportUtilService {
|
||||||
if (i == v.size()) {
|
if (i == v.size()) {
|
||||||
//如果系统内的所有版本都不是当前选择的数据更新版本,需要与lasted = 1 比较请求参数,参数一致,仅变更接口模块为当前导入接口的模块,不一致,新增并变更接口模块为当前导入接口的模块
|
//如果系统内的所有版本都不是当前选择的数据更新版本,需要与lasted = 1 比较请求参数,参数一致,仅变更接口模块为当前导入接口的模块,不一致,新增并变更接口模块为当前导入接口的模块
|
||||||
if (latestApi != null) {
|
if (latestApi != null) {
|
||||||
Boolean hasChange = ApiDefinitionImportUtil.checkIsSynchronize(latestApi, apiDefinitionWithBLOBs);
|
Boolean hasChange;
|
||||||
|
if (apiDefinitionWithBLOBs.getProtocol().equals("HTTP")) {
|
||||||
|
hasChange = ApiDefinitionImportUtil.checkIsSynchronize(latestApi, apiDefinitionWithBLOBs);
|
||||||
|
} else {
|
||||||
|
hasChange = true;
|
||||||
|
}
|
||||||
if (!hasChange) {
|
if (!hasChange) {
|
||||||
|
if (apiDefinitionWithBLOBs.getProtocol().equals("HTTP")) {
|
||||||
for (ApiDefinitionWithBLOBs definitionWithBLOBs : v) {
|
for (ApiDefinitionWithBLOBs definitionWithBLOBs : v) {
|
||||||
definitionWithBLOBs.setModuleId(apiDefinitionWithBLOBs.getModuleId());
|
definitionWithBLOBs.setModuleId(apiDefinitionWithBLOBs.getModuleId());
|
||||||
definitionWithBLOBs.setModulePath(apiDefinitionWithBLOBs.getModulePath());
|
definitionWithBLOBs.setModulePath(apiDefinitionWithBLOBs.getModulePath());
|
||||||
definitionWithBLOBs.setUpdateTime(System.currentTimeMillis());
|
definitionWithBLOBs.setUpdateTime(System.currentTimeMillis());
|
||||||
updateApiList.add(definitionWithBLOBs);
|
updateApiList.add(definitionWithBLOBs);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
apiDefinitionWithBLOBs.setVersionId("trash");
|
apiDefinitionWithBLOBs.setVersionId("trash");
|
||||||
} else {
|
} else {
|
||||||
addNewVersionApi(apiDefinitionWithBLOBs, latestApi, "update");
|
addNewVersionApi(apiDefinitionWithBLOBs, latestApi, "update");
|
||||||
|
if (apiDefinitionWithBLOBs.getProtocol().equals("HTTP")) {
|
||||||
for (ApiDefinitionWithBLOBs definitionWithBLOBs : v) {
|
for (ApiDefinitionWithBLOBs definitionWithBLOBs : v) {
|
||||||
definitionWithBLOBs.setModuleId(apiDefinitionWithBLOBs.getModuleId());
|
definitionWithBLOBs.setModuleId(apiDefinitionWithBLOBs.getModuleId());
|
||||||
definitionWithBLOBs.setModulePath(apiDefinitionWithBLOBs.getModulePath());
|
definitionWithBLOBs.setModulePath(apiDefinitionWithBLOBs.getModulePath());
|
||||||
|
@ -548,13 +556,16 @@ public class ApiDefinitionImportUtilService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (apiDefinitionWithBLOBs.getProtocol().equals("HTTP")) {
|
||||||
for (ApiDefinitionWithBLOBs definitionWithBLOBs : v) {
|
for (ApiDefinitionWithBLOBs definitionWithBLOBs : v) {
|
||||||
definitionWithBLOBs.setModuleId(apiDefinitionWithBLOBs.getModuleId());
|
definitionWithBLOBs.setModuleId(apiDefinitionWithBLOBs.getModuleId());
|
||||||
definitionWithBLOBs.setModulePath(apiDefinitionWithBLOBs.getModulePath());
|
definitionWithBLOBs.setModulePath(apiDefinitionWithBLOBs.getModulePath());
|
||||||
definitionWithBLOBs.setUpdateTime(System.currentTimeMillis());
|
definitionWithBLOBs.setUpdateTime(System.currentTimeMillis());
|
||||||
updateApiList.add(definitionWithBLOBs);
|
updateApiList.add(definitionWithBLOBs);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
optionData.remove(apiDefinitionWithBLOBs);
|
optionData.remove(apiDefinitionWithBLOBs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -862,7 +873,6 @@ public class ApiDefinitionImportUtilService {
|
||||||
if (MapUtils.isNotEmpty(caseNameMap)) {
|
if (MapUtils.isNotEmpty(caseNameMap)) {
|
||||||
buildCaseList(oldCaseMap, caseNameMap, definitionWithBLOBs, optionDataCases);
|
buildCaseList(oldCaseMap, caseNameMap, definitionWithBLOBs, optionDataCases);
|
||||||
}
|
}
|
||||||
|
|
||||||
ApiDefinitionWithBLOBs api = new ApiDefinitionWithBLOBs();
|
ApiDefinitionWithBLOBs api = new ApiDefinitionWithBLOBs();
|
||||||
BeanUtils.copyBean(api, apiDefinitionWithBLOBs);
|
BeanUtils.copyBean(api, apiDefinitionWithBLOBs);
|
||||||
api.setId(definitionWithBLOBs.getId());
|
api.setId(definitionWithBLOBs.getId());
|
||||||
|
@ -874,7 +884,12 @@ public class ApiDefinitionImportUtilService {
|
||||||
}
|
}
|
||||||
if (i == v.size()) {
|
if (i == v.size()) {
|
||||||
if (latestApi!=null) {
|
if (latestApi!=null) {
|
||||||
Boolean hasChange = ApiDefinitionImportUtil.checkIsSynchronize(latestApi, apiDefinitionWithBLOBs);
|
boolean hasChange;
|
||||||
|
if (apiDefinitionWithBLOBs.getProtocol().equals("HTTP")) {
|
||||||
|
hasChange = ApiDefinitionImportUtil.checkIsSynchronize(latestApi, apiDefinitionWithBLOBs);
|
||||||
|
} else {
|
||||||
|
hasChange = true;
|
||||||
|
}
|
||||||
if (!hasChange) {
|
if (!hasChange) {
|
||||||
optionData.remove(apiDefinitionWithBLOBs);
|
optionData.remove(apiDefinitionWithBLOBs);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -783,7 +783,7 @@ public class ApiDefinitionService {
|
||||||
apiTestCaseService.updateByApiDefinitionId(ids, test, request.getTriggerUpdate());
|
apiTestCaseService.updateByApiDefinitionId(ids, test, request.getTriggerUpdate());
|
||||||
}
|
}
|
||||||
ApiDefinitionWithBLOBs result = apiDefinitionMapper.selectByPrimaryKey(test.getId());
|
ApiDefinitionWithBLOBs result = apiDefinitionMapper.selectByPrimaryKey(test.getId());
|
||||||
checkAndSetLatestVersion(result.getRefId());
|
//checkAndSetLatestVersion(result.getRefId());
|
||||||
|
|
||||||
// 存储附件关系
|
// 存储附件关系
|
||||||
extFileAssociationService.saveApi(test.getId(), request.getRequest(), FileAssociationTypeEnums.API.name());
|
extFileAssociationService.saveApi(test.getId(), request.getRequest(), FileAssociationTypeEnums.API.name());
|
||||||
|
|
|
@ -409,7 +409,7 @@ public class ApiScenarioService {
|
||||||
if (relationshipEdgeService != null) {
|
if (relationshipEdgeService != null) {
|
||||||
relationshipEdgeService.initRelationshipEdge(beforeScenario, scenario);
|
relationshipEdgeService.initRelationshipEdge(beforeScenario, scenario);
|
||||||
}
|
}
|
||||||
checkAndSetLatestVersion(beforeScenario.getRefId());
|
//checkAndSetLatestVersion(beforeScenario.getRefId());
|
||||||
// 存储附件关系
|
// 存储附件关系
|
||||||
extFileAssociationService.saveScenario(scenario.getId(), request.getScenarioDefinition());
|
extFileAssociationService.saveScenario(scenario.getId(), request.getScenarioDefinition());
|
||||||
return scenario;
|
return scenario;
|
||||||
|
|
|
@ -325,7 +325,7 @@ public class PerformanceTestService {
|
||||||
copyLoadTestFiles(testId, loadTest.getId());
|
copyLoadTestFiles(testId, loadTest.getId());
|
||||||
loadTestMapper.insertSelective(loadTest);
|
loadTestMapper.insertSelective(loadTest);
|
||||||
}
|
}
|
||||||
checkAndSetLatestVersion(loadTest.getRefId());
|
//checkAndSetLatestVersion(loadTest.getRefId());
|
||||||
return loadTest;
|
return loadTest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -463,7 +463,7 @@ public class TestCaseService {
|
||||||
dealWithOtherInfoOfNewVersion(testCase, oldTestCase.getId());
|
dealWithOtherInfoOfNewVersion(testCase, oldTestCase.getId());
|
||||||
testCaseMapper.insertSelective(testCase);
|
testCaseMapper.insertSelective(testCase);
|
||||||
}
|
}
|
||||||
checkAndSetLatestVersion(testCase.getRefId());
|
//checkAndSetLatestVersion(testCase.getRefId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue