From 498c6a4d4e31f81e12f4022b8dba507a59a8ba11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=9A=E8=B1=86=E8=B1=86?= <13356128+sunandmoon60@user.noreply.gitee.com> Date: Thu, 6 Nov 2025 09:51:06 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=BE=AE=E6=9C=8D=E5=8A=A1=E5=B7=A5=E5=8E=82?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lc123/cloud/app/eip/iscb/ServiceFactory.java | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lc123/cloud/app/eip/iscb/ServiceFactory.java diff --git a/lc123/cloud/app/eip/iscb/ServiceFactory.java b/lc123/cloud/app/eip/iscb/ServiceFactory.java new file mode 100644 index 0000000..c80504e --- /dev/null +++ b/lc123/cloud/app/eip/iscb/ServiceFactory.java @@ -0,0 +1,24 @@ +package tqq9.lc123.cloud.app.eip.iscb; + +import kd.bos.dataentity.TypesContainer; +import kd.bos.dataentity.resource.ResManager; + +import java.util.HashMap; +import java.util.Map; + +public class ServiceFactory { + private static Map serviceMap = new HashMap<>(); + + static { + serviceMap.put("LCLogService","tqq9.lc123.cloud.app.eip.iscb.impl.LCLogServiceImpl"); + } + + public static Object getService(String serviceName) { + String className = serviceMap.get(serviceName); + if (className == null) { + throw new RuntimeException(String.format( + ResManager.loadKDString("%s对应的服务实现未找到", "ServiceFactory_0", "bos-ecos-mservice"), serviceName)); + } + return TypesContainer.getOrRegisterSingletonInstance(className); + } +} \ No newline at end of file