From 59c6581165cb10a845224d2036a82dc253ee29cb Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Thu, 14 Dec 2023 11:06:25 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E5=8E=BB=E6=8E=89=E8=8E=B7=E5=8F=96license=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sdk/util/FilterChainUtils.java | 2 -- .../controller/ApiTaskRunnerController.java | 24 ------------------- .../ApiTaskRunnerControllerTests.java | 24 ------------------- 3 files changed, 50 deletions(-) delete mode 100644 backend/services/api-test/src/main/java/io/metersphere/api/controller/ApiTaskRunnerController.java delete mode 100644 backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiTaskRunnerControllerTests.java diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/FilterChainUtils.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/FilterChainUtils.java index 2ef617f852..651c104459 100644 --- a/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/FilterChainUtils.java +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/FilterChainUtils.java @@ -63,8 +63,6 @@ public class FilterChainUtils { // 获取插件中的图片 filterChainDefinitionMap.put("/plugin/image/**", "anon"); - // task runner code - filterChainDefinitionMap.put("/task/runner/get/**", "anon"); return filterChainDefinitionMap; } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/controller/ApiTaskRunnerController.java b/backend/services/api-test/src/main/java/io/metersphere/api/controller/ApiTaskRunnerController.java deleted file mode 100644 index a3e49b9659..0000000000 --- a/backend/services/api-test/src/main/java/io/metersphere/api/controller/ApiTaskRunnerController.java +++ /dev/null @@ -1,24 +0,0 @@ -package io.metersphere.api.controller; - -import io.metersphere.sdk.util.CommonBeanFactory; -import io.metersphere.system.service.LicenseService; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/task/runner") -@Tag(name = "执行开放API") -public class ApiTaskRunnerController { - - @GetMapping("/get/{encrypt}") - public String getCode(@PathVariable String encrypt) { - LicenseService licenseService = CommonBeanFactory.getBean(LicenseService.class); - if (licenseService != null) { - return licenseService.getCode(encrypt); - } - return null; - } -} diff --git a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiTaskRunnerControllerTests.java b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiTaskRunnerControllerTests.java deleted file mode 100644 index 7addbc15ee..0000000000 --- a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiTaskRunnerControllerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -package io.metersphere.api.controller; - -import io.metersphere.system.base.BaseTest; -import org.junit.jupiter.api.MethodOrderer; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -@AutoConfigureMockMvc -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public class ApiTaskRunnerControllerTests extends BaseTest { - private static final String BASE_PATH = "/task/runner/get/test-code"; - - @Test - @Order(0) - public void testCode() throws Exception { - // @@校验没有数据的情况 - this.requestGetWithOk(BASE_PATH); - } - -}