From 20d7a57ea9eda6f2d8d6eaf8f7783a97137484ca Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Thu, 16 Feb 2023 18:19:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtcp-mock=E6=97=A0=E6=B3=95=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1023126 --user=宋天阳 【接口测试】开启 tcp mock 服务报错了 https://www.tapd.cn/55049933/s/1336772 --- .../metersphere/service/ProjectApplicationService.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/project-management/backend/src/main/java/io/metersphere/service/ProjectApplicationService.java b/project-management/backend/src/main/java/io/metersphere/service/ProjectApplicationService.java index e3bda8471d..ce44261166 100644 --- a/project-management/backend/src/main/java/io/metersphere/service/ProjectApplicationService.java +++ b/project-management/backend/src/main/java/io/metersphere/service/ProjectApplicationService.java @@ -20,6 +20,7 @@ import io.metersphere.log.vo.OperatingLogDetails; import io.metersphere.log.vo.system.SystemReference; import io.metersphere.request.AddProjectRequest; import io.metersphere.request.ProjectApplicationRequest; +import jakarta.annotation.Resource; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; @@ -27,7 +28,6 @@ import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import jakarta.annotation.Resource; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.*; @@ -82,7 +82,7 @@ public class ProjectApplicationService { config.setCleanApiReport(cleanUp); } else if (StringUtils.equals(type, ProjectApplicationType.CLEAN_LOAD_REPORT.name())) { config.setCleanLoadReport(cleanUp); - } else if(StringUtils.equals(type, ProjectApplicationType.CLEAN_UI_REPORT.name())){ + } else if (StringUtils.equals(type, ProjectApplicationType.CLEAN_UI_REPORT.name())) { config.setCleanUiReport(cleanUp); } // 根据这三个状态判断定时清理任务是否开启 @@ -178,12 +178,12 @@ public class ProjectApplicationService { private void closeMockTcp(int tcpPort) { if (tcpPort != 0) { - microService.getForData(MicroServiceName.API_TEST, "/mock/config/close/tcp/" + tcpPort); + microService.getForData(MicroServiceName.API_TEST, "/mock-config/close/tcp/" + tcpPort); } } private void createTcp(Integer mockPort) { - microService.getForData(MicroServiceName.API_TEST, "/mock/config/open/tcp/" + mockPort); + microService.getForData(MicroServiceName.API_TEST, "/mock-config/open/tcp/" + mockPort); } private void reloadMockTcp(Project project, int oldPort) { @@ -428,6 +428,7 @@ public class ProjectApplicationService { private void doHandleTestCaseCustomNum(String projectId) { microService.getForData(MicroServiceName.TEST_TRACK, "/test/case/update/custom/num/" + projectId); } + public void deleteRelateProjectConfig(String projectId) { ProjectApplicationExample example = new ProjectApplicationExample(); example.createCriteria().andProjectIdEqualTo(projectId);