feat(接口测试): 接口测试导入

--user=郭雨琦
This commit is contained in:
guoyuqi 2022-12-14 11:42:55 +08:00 committed by 刘瑞斌
parent a2b4c68319
commit 5d50db90b6
1 changed files with 5 additions and 3 deletions

View File

@ -240,7 +240,7 @@ public class ApiDefinitionImportUtilService {
sameRefIds = toUpdates;
}
}
if (item.getVersionId().equalsIgnoreCase("trash")) {
if (StringUtils.equalsIgnoreCase(item.getVersionId(), "trash")) {
if (CollectionUtils.isNotEmpty(sameRefIds)) {
for (ApiDefinitionWithBLOBs sameRefId : sameRefIds) {
batchMapper.updateByPrimaryKey(sameRefId);
@ -669,8 +669,11 @@ public class ApiDefinitionImportUtilService {
}
private static void updateExitData(ApiDefinitionMapper batchMapper, ApiDefinitionImportParamDTO apiDefinitionImportParamDTO, ApiDefinitionWithBLOBs apiDefinition) {
List<ApiDefinitionWithBLOBs> repeatList = apiDefinitionImportParamDTO.getRepeatList();
if (CollectionUtils.isEmpty(repeatList)) {
return;
}
if (apiDefinition.getLatest()) {
List<ApiDefinitionWithBLOBs> repeatList = apiDefinitionImportParamDTO.getRepeatList();
for (ApiDefinitionWithBLOBs apiDefinitionWithBLOBs : repeatList) {
if (apiDefinitionWithBLOBs.getLatest()) {
apiDefinitionWithBLOBs.setLatest(false);
@ -678,7 +681,6 @@ public class ApiDefinitionImportUtilService {
batchMapper.updateByPrimaryKey(apiDefinitionWithBLOBs);
}
} else {
List<ApiDefinitionWithBLOBs> repeatList = apiDefinitionImportParamDTO.getRepeatList();
for (ApiDefinitionWithBLOBs apiDefinitionWithBLOBs : repeatList) {
batchMapper.updateByPrimaryKey(apiDefinitionWithBLOBs);
}