From 60f93da97bfc864b4526a3eb47492f1ddd405f12 Mon Sep 17 00:00:00 2001 From: Anner Date: Tue, 19 Nov 2024 10:46:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-139789=20fix:=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=90=AF=E5=8A=A8=E6=8F=92=E4=BB=B6=E5=BC=95=E6=93=8E?= =?UTF-8?q?=E6=B3=A8=E5=86=8Cchecker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../boot/env/DesignPluginComponent.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fanruan/boot/env/DesignPluginComponent.java b/designer-realize/src/main/java/com/fanruan/boot/env/DesignPluginComponent.java index bab4a43c1d..30a471fb27 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/env/DesignPluginComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/env/DesignPluginComponent.java @@ -15,8 +15,10 @@ import com.fr.invoke.ClassFactory; import com.fr.json.JSONObject; import com.fr.plugin.beforeload.embed.PluginEmbedInfo; import com.fr.plugin.config.PluginConfigContext; -import com.fr.plugin.db.PluginDBManager; +import com.fr.plugin.injectable.LevelChecker; import com.fr.plugin.injectable.PluginInjectionFilter; +import com.fr.plugin.injectable.PluginInjectionValidator; +import com.fr.plugin.injectable.SpecialLevel; import com.fr.plugin.manage.PluginManager; import com.fr.plugin.manage.PluginSyncModuleType; import com.fr.plugin.observer.PluginEvent; @@ -24,6 +26,7 @@ import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginListenerRegistration; import com.fr.plugin.validate.PluginValidator; import com.fr.stable.CommonUtils; +import com.fr.stable.fun.Level; import com.fr.stable.project.ProjectConstants; import com.fr.stable.resource.ResourceLoader; import com.fr.startup.web.annotation.MappingJackson2HttpMessageConverter; @@ -76,6 +79,20 @@ public class DesignPluginComponent extends PluginComponent { // 注册插件配置类Provider registerPluginConfigProvider(); + PluginInjectionValidator.setLevelChecker(new LevelChecker() { + @Override + public boolean isStandard(String name) { + //不在特殊表中的Level + return SpecialLevel.convert(name) == null; + } + + @Override + public boolean validateSpecificLevel(String name, Level injectionObject) { + SpecialLevel specialLevel = SpecialLevel.convert(name); + return specialLevel == null || specialLevel.getCurrentLevel() <= injectionObject.currentAPILevel(); + } + }); + AutonomyClassManagerFactory.getInstance().registerAutonomyClassManager(Carina.getApplicationContext().group(AutonomyClassManagerGroup.class).getAll().toArray(new AutonomyClassManagerProvider[0])); @@ -92,7 +109,6 @@ public class DesignPluginComponent extends PluginComponent { } }); registerPluginClassFinder(); - PluginDBManager.getInstance().init(); } @Override @@ -145,6 +161,5 @@ public class DesignPluginComponent extends PluginComponent { @Stop public void stop() { super.stop(); - PluginDBManager.getInstance().destroy(); } } From 49bce31144e375ec7ed1c304490151ca5e404583 Mon Sep 17 00:00:00 2001 From: Anner Date: Tue, 19 Nov 2024 10:54:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-139789=20fix:=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=90=AF=E5=8A=A8=E6=8F=92=E4=BB=B6=E5=BC=95=E6=93=8E?= =?UTF-8?q?=E6=B3=A8=E5=86=8Cchecker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fanruan/boot/env/DesignPluginComponent.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-realize/src/main/java/com/fanruan/boot/env/DesignPluginComponent.java b/designer-realize/src/main/java/com/fanruan/boot/env/DesignPluginComponent.java index 30a471fb27..3bf6495a7b 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/env/DesignPluginComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/env/DesignPluginComponent.java @@ -15,6 +15,7 @@ import com.fr.invoke.ClassFactory; import com.fr.json.JSONObject; import com.fr.plugin.beforeload.embed.PluginEmbedInfo; import com.fr.plugin.config.PluginConfigContext; +import com.fr.plugin.db.PluginDBManager; import com.fr.plugin.injectable.LevelChecker; import com.fr.plugin.injectable.PluginInjectionFilter; import com.fr.plugin.injectable.PluginInjectionValidator; @@ -109,6 +110,7 @@ public class DesignPluginComponent extends PluginComponent { } }); registerPluginClassFinder(); + PluginDBManager.getInstance().init(); } @Override @@ -161,5 +163,6 @@ public class DesignPluginComponent extends PluginComponent { @Stop public void stop() { super.stop(); + PluginDBManager.getInstance().destroy(); } }