fix(接口测试): 修改接口导入的逻辑

--bug=1046233 --user=宋天阳 【接口测试】接口导入-MeterSphere格式-当前项目接口与模块均与被导入接口一致-覆盖模块导入-用例未更新 https://www.tapd.cn/55049933/s/1577374
This commit is contained in:
Jianguo-Genius 2024-09-11 18:48:30 +08:00 committed by Craftsman
parent f1c07a1872
commit 8a9808f541
1 changed files with 14 additions and 16 deletions

View File

@ -569,23 +569,21 @@ public class ApiDefinitionImportService {
boolean isSameModule = StringUtils.equals(importApi.getModuleId(), existenceApi.getModuleId());
/*
开启模块覆盖并覆盖接口此时有4种情况
接口请求一样模块一样 不处理
*/
if (isSameRequest && isSameModule) {
//接口请求一样模块一样 不处理
continue;
}
if (!isSameRequest && isSameModule) {
//接口请求不一样模块一样更新接口的非模块信息
this.updateApiDefinitionRequest(importApi, existenceMsHTTPElement, request.getPlatform());
apiDefinitionPreImportAnalysisResult.getUpdateApiData().add(importApi);
} else if (isSameRequest) {
//接口请求一样模块不一样只更新接口模块信息
apiDefinitionPreImportAnalysisResult.getUpdateModuleApiList().add(importApi);
} else {
//接口请求不一样模块不一样更新接口所有信息
this.updateApiDefinitionRequest(importApi, existenceMsHTTPElement, request.getPlatform());
apiDefinitionPreImportAnalysisResult.getUpdateApiData().add(importApi);
if (!isSameRequest || !isSameModule) {
if (!isSameRequest && isSameModule) {
//接口请求不一样模块一样更新接口的非模块信息
this.updateApiDefinitionRequest(importApi, existenceMsHTTPElement, request.getPlatform());
apiDefinitionPreImportAnalysisResult.getUpdateApiData().add(importApi);
} else if (isSameRequest) {
//接口请求一样模块不一样只更新接口模块信息
apiDefinitionPreImportAnalysisResult.getUpdateModuleApiList().add(importApi);
} else {
//接口请求不一样模块不一样更新接口所有信息
this.updateApiDefinitionRequest(importApi, existenceMsHTTPElement, request.getPlatform());
apiDefinitionPreImportAnalysisResult.getUpdateApiData().add(importApi);
}
}
} else {
if (!isSameRequest) {