【代码评审】IoT:评审 plugin 实现

This commit is contained in:
YunaiV
2024-12-21 16:28:25 +08:00
parent a2532013ec
commit e998b0c7eb
11 changed files with 42 additions and 37 deletions

View File

@@ -22,6 +22,7 @@
<artifactId>yudao-common</artifactId>
</dependency>
<!-- PF4J -->
<!-- TODO 芋艿:这个依赖,要不要放在 api 包 -->
<dependency>
<groupId>org.pf4j</groupId>
<artifactId>pf4j-spring</artifactId>

View File

@@ -7,6 +7,7 @@ import java.util.Map;
* 服务注册表 - 插架模块使用,无法使用 Spring 注入
*/
public class ServiceRegistry {
private static final Map<Class<?>, Object> services = new HashMap<>();
/**
@@ -31,4 +32,5 @@ public class ServiceRegistry {
public static <T> T getService(Class<T> serviceClass) {
return (T) services.get(serviceClass);
}
}