From 31c9897746a144fddcec09a5cc173c1c42e28524 Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Wed, 7 Feb 2024 17:23:21 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E8=8E=B7=E5=8F=96=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=84=9A=E6=9C=AC=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/metersphere/api/service/ApiTestService.java | 2 +- .../java/io/metersphere/system/service/PluginLoadService.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTestService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTestService.java index 6cfac1e22d..aefbdef5e4 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTestService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTestService.java @@ -63,7 +63,7 @@ public class ApiTestService { PluginWrapper pluginWrapper = pluginLoadService.getPluginWrapper(pluginId); checkResourceExist(pluginWrapper); if (pluginWrapper.getPlugin() instanceof AbstractProtocolPlugin protocolPlugin) { - return pluginLoadService.getPluginScriptContent(pluginId, protocolPlugin.getApiProtocolScriptId()); + return pluginLoadService.getPluginScript(pluginId, protocolPlugin.getApiProtocolScriptId()); } else { // 插件不存在或者非接口插件,抛出异常 return checkResourceExist(null); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/service/PluginLoadService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/service/PluginLoadService.java index 01a5499212..0095347b52 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/service/PluginLoadService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/service/PluginLoadService.java @@ -259,6 +259,10 @@ public class PluginLoadService { return getPluginScriptConfig(pluginId, scriptId).get("script"); } + public Object getPluginScript(String pluginId, String scriptId) { + return getPluginScriptConfig(pluginId, scriptId); + } + public PluginWrapper getPluginWrapper(String id) { return msPluginManager.getPlugin(id); }