fix(接口定义): 默认模块校验问题修改
This commit is contained in:
parent
c23a31400e
commit
cc13993abc
|
@ -241,7 +241,7 @@ public class ApiAutomationService {
|
||||||
} else {
|
} else {
|
||||||
scenario.setUserId(request.getUserId());
|
scenario.setUserId(request.getUserId());
|
||||||
}
|
}
|
||||||
if (StringUtils.isEmpty(request.getApiScenarioModuleId()) || StringUtils.isEmpty(request.getModulePath()) || "default-module".equals(request.getApiScenarioModuleId())) {
|
if (StringUtils.isEmpty(request.getApiScenarioModuleId()) || "default-module".equals(request.getApiScenarioModuleId())) {
|
||||||
ApiScenarioModuleExample example = new ApiScenarioModuleExample();
|
ApiScenarioModuleExample example = new ApiScenarioModuleExample();
|
||||||
example.createCriteria().andProjectIdEqualTo(request.getProjectId()).andNameEqualTo("默认模块");
|
example.createCriteria().andProjectIdEqualTo(request.getProjectId()).andNameEqualTo("默认模块");
|
||||||
List<ApiScenarioModule> modules = apiScenarioModuleMapper.selectByExample(example);
|
List<ApiScenarioModule> modules = apiScenarioModuleMapper.selectByExample(example);
|
||||||
|
|
|
@ -264,7 +264,7 @@ public class ApiDefinitionService {
|
||||||
test.setEnvironmentId(request.getEnvironmentId());
|
test.setEnvironmentId(request.getEnvironmentId());
|
||||||
test.setUserId(request.getUserId());
|
test.setUserId(request.getUserId());
|
||||||
test.setTags(request.getTags());
|
test.setTags(request.getTags());
|
||||||
if (StringUtils.isEmpty(request.getModulePath()) || StringUtils.isEmpty(request.getModuleId()) || "default-module".equals(request.getModuleId())) {
|
if (StringUtils.isEmpty(request.getModuleId()) || "default-module".equals(request.getModuleId())) {
|
||||||
ApiModuleExample example = new ApiModuleExample();
|
ApiModuleExample example = new ApiModuleExample();
|
||||||
example.createCriteria().andProjectIdEqualTo(test.getProjectId()).andProtocolEqualTo(test.getProtocol()).andNameEqualTo("默认模块");
|
example.createCriteria().andProjectIdEqualTo(test.getProjectId()).andProtocolEqualTo(test.getProtocol()).andNameEqualTo("默认模块");
|
||||||
List<ApiModule> modules = apiModuleMapper.selectByExample(example);
|
List<ApiModule> modules = apiModuleMapper.selectByExample(example);
|
||||||
|
@ -297,7 +297,7 @@ public class ApiDefinitionService {
|
||||||
test.setStatus(APITestStatus.Underway.name());
|
test.setStatus(APITestStatus.Underway.name());
|
||||||
test.setModulePath(request.getModulePath());
|
test.setModulePath(request.getModulePath());
|
||||||
test.setModuleId(request.getModuleId());
|
test.setModuleId(request.getModuleId());
|
||||||
if (StringUtils.isEmpty(request.getModulePath()) || StringUtils.isEmpty(request.getModuleId()) || "default-module".equals(request.getModuleId())) {
|
if (StringUtils.isEmpty(request.getModuleId()) || "default-module".equals(request.getModuleId())) {
|
||||||
ApiModuleExample example = new ApiModuleExample();
|
ApiModuleExample example = new ApiModuleExample();
|
||||||
example.createCriteria().andProjectIdEqualTo(test.getProjectId()).andProtocolEqualTo(test.getProtocol()).andNameEqualTo("默认模块");
|
example.createCriteria().andProjectIdEqualTo(test.getProjectId()).andProtocolEqualTo(test.getProtocol()).andNameEqualTo("默认模块");
|
||||||
List<ApiModule> modules = apiModuleMapper.selectByExample(example);
|
List<ApiModule> modules = apiModuleMapper.selectByExample(example);
|
||||||
|
@ -616,7 +616,7 @@ public class ApiDefinitionService {
|
||||||
}
|
}
|
||||||
for (int i = 0; i < data.size(); i++) {
|
for (int i = 0; i < data.size(); i++) {
|
||||||
ApiDefinitionWithBLOBs item = data.get(i);
|
ApiDefinitionWithBLOBs item = data.get(i);
|
||||||
if (StringUtils.isEmpty(item.getModuleId()) || StringUtils.isEmpty(item.getModulePath()) || "default-module".equals(item.getModuleId())) {
|
if (StringUtils.isEmpty(item.getModuleId()) || "default-module".equals(item.getModuleId())) {
|
||||||
ApiModuleExample example = new ApiModuleExample();
|
ApiModuleExample example = new ApiModuleExample();
|
||||||
example.createCriteria().andProjectIdEqualTo(item.getProjectId()).andProtocolEqualTo(item.getProtocol()).andNameEqualTo("默认模块");
|
example.createCriteria().andProjectIdEqualTo(item.getProjectId()).andProtocolEqualTo(item.getProtocol()).andNameEqualTo("默认模块");
|
||||||
List<ApiModule> modules = apiModuleMapper.selectByExample(example);
|
List<ApiModule> modules = apiModuleMapper.selectByExample(example);
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class TestCaseService {
|
||||||
TestCaseTestMapper testCaseTestMapper;
|
TestCaseTestMapper testCaseTestMapper;
|
||||||
|
|
||||||
private void setNode(TestCaseWithBLOBs testCase){
|
private void setNode(TestCaseWithBLOBs testCase){
|
||||||
if (StringUtils.isEmpty(testCase.getNodeId()) || StringUtils.isEmpty(testCase.getNodePath()) || "default-module".equals(testCase.getNodeId())) {
|
if (StringUtils.isEmpty(testCase.getNodeId()) || "default-module".equals(testCase.getNodeId())) {
|
||||||
TestCaseNodeExample example = new TestCaseNodeExample();
|
TestCaseNodeExample example = new TestCaseNodeExample();
|
||||||
example.createCriteria().andProjectIdEqualTo(testCase.getProjectId()).andNameEqualTo("默认模块");
|
example.createCriteria().andProjectIdEqualTo(testCase.getProjectId()).andNameEqualTo("默认模块");
|
||||||
List<TestCaseNode> nodes = testCaseNodeMapper.selectByExample(example);
|
List<TestCaseNode> nodes = testCaseNodeMapper.selectByExample(example);
|
||||||
|
|
Loading…
Reference in New Issue