diff --git a/api-test/backend/src/main/java/io/metersphere/listener/ApiAppStartListener.java b/api-test/backend/src/main/java/io/metersphere/listener/ApiAppStartListener.java index e6ce8e66b2..2d9123a011 100644 --- a/api-test/backend/src/main/java/io/metersphere/listener/ApiAppStartListener.java +++ b/api-test/backend/src/main/java/io/metersphere/listener/ApiAppStartListener.java @@ -18,8 +18,6 @@ import org.python.util.PythonInterpreter; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; -import org.springframework.boot.context.event.ApplicationReadyEvent; -import org.springframework.context.ApplicationListener; import org.springframework.stereotype.Component; import javax.annotation.Resource; diff --git a/api-test/backend/src/main/java/io/metersphere/service/MsHashTreeService.java b/api-test/backend/src/main/java/io/metersphere/service/MsHashTreeService.java index a95fa09e5f..93413e2e6f 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/MsHashTreeService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/MsHashTreeService.java @@ -1,9 +1,9 @@ package io.metersphere.service; import io.metersphere.api.dto.automation.ApiScenarioDTO; +import io.metersphere.api.dto.definition.ApiDefinitionResult; import io.metersphere.api.dto.definition.ApiTestCaseInfo; import io.metersphere.api.dto.definition.request.ElementUtil; -import io.metersphere.base.domain.ApiDefinition; import io.metersphere.base.domain.ApiScenarioWithBLOBs; import io.metersphere.base.domain.ApiTestCaseWithBLOBs; import io.metersphere.base.domain.Project; @@ -174,11 +174,11 @@ public class MsHashTreeService { this.setElement(element, apiTestCase.getNum(), enable, apiTestCase.getVersionName(), apiTestCase.getVersionEnable()); } } else if (StringUtils.equalsIgnoreCase(element.optString(REFERENCED), COPY)) { - ApiDefinition definition = apiDefinitionMapper.selectByPrimaryKey(element.optString(ID)); + ApiDefinitionResult definition = apiDefinitionService.getById(element.optString(ID)); if (definition != null) { Project project = projectMapper.selectByPrimaryKey(definition.getProjectId()); element.put(ID, definition.getId()); - this.setElement(element, definition.getNum(), enable, project.getName(), project.getVersionEnable()); + this.setElement(element, definition.getNum(), enable, definition.getVersionName(), project.getVersionEnable()); isExist = true; } }