From 26d6acc32e9be794b5fefdfc34c3574e1a6be34e Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 25 Oct 2022 14:41:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E6=8E=A5=E5=8F=A3=E5=AF=BC=E5=85=A5=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E5=BE=85=E6=9B=B4=E6=96=B0=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 --- .../definition/ApiDefinitionService.java | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java index 7500ecd6f9..af62409fd4 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java @@ -1174,15 +1174,7 @@ public class ApiDefinitionService { } else if (apiTestImportRequest.getCoverModule() != null && apiTestImportRequest.getCoverModule()) { apiDefinition.setUpdateTime(System.currentTimeMillis()); } - - if (CollectionUtils.isEmpty(caseList)) { - apiDefinition.setToBeUpdated(false); - } else { - List oldCaseList = caseList.stream().filter(t -> StringUtils.equalsIgnoreCase("old_case", t.getVersionId()) && StringUtils.isNotBlank(t.getId())).collect(Collectors.toList()); - if (CollectionUtils.isEmpty(oldCaseList)) { - apiDefinition.setToBeUpdated(false); - } - } + } else { apiDefinition.setUpdateTime(System.currentTimeMillis()); } @@ -1319,7 +1311,6 @@ public class ApiDefinitionService { diffByNodes = getDiffByArrayNodes(apiRequest, exApiRequest, objectMapper, property); if (diffByNodes) { if (toUpdate && applicationMap.get(property)) { - apiDefinition.setToBeUpdated(true); apiDefinition.setToBeUpdateTime(System.currentTimeMillis()); } break; @@ -1341,7 +1332,6 @@ public class ApiDefinitionService { if (exRowNode != null && rowNode != null) { if (!StringUtils.equals(exRowNode.asText(), rowNode.asText())) { if (applicationMap.get(BODY)) { - apiDefinition.setToBeUpdated(true); apiDefinition.setToBeUpdateTime(System.currentTimeMillis()); } return true; @@ -1350,7 +1340,6 @@ public class ApiDefinitionService { boolean diffByNodes = getDiffByArrayNodes(bodyNode, exBodyNode, objectMapper, "kvs"); if (diffByNodes && toUpdate && applicationMap.get(BODY)) { - apiDefinition.setToBeUpdated(true); apiDefinition.setToBeUpdateTime(System.currentTimeMillis()); } if (diffByNodes) { @@ -1369,7 +1358,6 @@ public class ApiDefinitionService { } boolean diffJsonschema = replenishCaseProperties(exApiProperties, apiProperties); if (diffJsonschema && toUpdate && applicationMap.get(BODY)) { - apiDefinition.setToBeUpdated(true); apiDefinition.setToBeUpdateTime(System.currentTimeMillis()); } return diffJsonschema; @@ -1425,14 +1413,12 @@ public class ApiDefinitionService { private static Boolean delBasicInfo(ApiDefinitionWithBLOBs existApi, ApiDefinitionWithBLOBs apiDefinition, ApiSyncCaseRequest apiSyncCaseRequest, Boolean toUpdate) { if (!StringUtils.equals(apiDefinition.getMethod(), existApi.getMethod())) { if (apiSyncCaseRequest.getMethod() && toUpdate) { - apiDefinition.setToBeUpdated(true); apiDefinition.setToBeUpdateTime(System.currentTimeMillis()); } return true; } if (!StringUtils.equals(apiDefinition.getProtocol(), existApi.getProtocol())) { if (apiSyncCaseRequest.getProtocol() && toUpdate) { - apiDefinition.setToBeUpdated(true); apiDefinition.setToBeUpdateTime(System.currentTimeMillis()); } return true; @@ -1440,7 +1426,6 @@ public class ApiDefinitionService { if (!StringUtils.equals(apiDefinition.getPath(), existApi.getPath())) { if (apiSyncCaseRequest.getPath() && toUpdate) { - apiDefinition.setToBeUpdated(true); apiDefinition.setToBeUpdateTime(System.currentTimeMillis()); } return true;