From fabaffad25dc80aafe80a1167b91c288b5a1bf7c Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 13 Dec 2022 15:24:33 +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=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 --- .../service/definition/ApiDefinitionImportUtilService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionImportUtilService.java b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionImportUtilService.java index 7f342e5d36..01e8a01850 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionImportUtilService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionImportUtilService.java @@ -24,6 +24,7 @@ import io.metersphere.service.BaseProjectApplicationService; import io.metersphere.service.MockConfigService; import io.metersphere.service.ServiceUtils; import io.metersphere.service.ext.ExtApiScheduleService; +import io.metersphere.xpack.api.service.ApiDefinitionSyncService; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; @@ -55,8 +56,6 @@ public class ApiDefinitionImportUtilService { @Resource private BaseProjectApplicationService projectApplicationService; @Resource - private ApiModuleService apiModuleService; - @Resource private SqlSessionFactory sqlSessionFactory; @Resource private BaseProjectVersionMapper baseProjectVersionMapper; @@ -172,6 +171,7 @@ public class ApiDefinitionImportUtilService { if (filterData.isEmpty()) { return new ArrayList<>(); } + ApiModuleService apiModuleService = CommonBeanFactory.getBean(ApiModuleService.class); //处理模块路径 UpdateApiModuleDTO updateApiModuleDTO = apiModuleService.checkApiModule(request, apiImport, filterData, StringUtils.equals("fullCoverage", request.getModeId()), urlRepeat); //重新设置模块路径后的数据 @@ -1006,6 +1006,7 @@ public class ApiDefinitionImportUtilService { if (StringUtils.isBlank(modulePath)) { return; } + ApiModuleService apiModuleService = CommonBeanFactory.getBean(ApiModuleService.class); String[] pathTree = apiModuleService.getPathTree(modulePath); String lastPath = pathTree[pathTree.length - 1]; String substring = modulePath.substring(0, modulePath.indexOf("/" + lastPath)); @@ -1240,4 +1241,5 @@ public class ApiDefinitionImportUtilService { currentApiCaseOrder.set(order); return order; } + }