From 6686e2747fdc53e8e463dec6a331e28f64e430b3 Mon Sep 17 00:00:00 2001 From: jsowell <123@jsowell.com> Date: Wed, 10 Jun 2026 16:39:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4Strategy=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../netty/factory/YKCOperateFactoryV2.java | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 jsowell-netty/src/main/java/com/jsowell/netty/factory/YKCOperateFactoryV2.java diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/factory/YKCOperateFactoryV2.java b/jsowell-netty/src/main/java/com/jsowell/netty/factory/YKCOperateFactoryV2.java deleted file mode 100644 index c8ae77570..000000000 --- a/jsowell-netty/src/main/java/com/jsowell/netty/factory/YKCOperateFactoryV2.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.jsowell.netty.factory; - -import com.alibaba.fastjson2.JSON; -import com.jsowell.common.util.StringUtils; -import com.jsowell.netty.strategy.ykc.AbstractYkcStrategy; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.HashMap; -import java.util.Map; - -/** - * 工厂设计模式 - * 云快充操作 - */ -@Component -public class YKCOperateFactoryV2 { - - @Autowired - private Map strategyMap; - - private static Map operationMap = new HashMap<>(); - - // static { - // //初始化实现类 - // operationMap.put("0x01", "loginRequestStrategy"); - // operationMap.put("0x05", "billingTemplateValidateRequestStrategy"); - // // more operators - // } - - /** - * 注册 - * @param str - * @param strategyName - */ - public static void register(String str, String strategyName) { - if (StringUtils.isBlank(str) || StringUtils.isBlank(strategyName)) { - return; - } - // 获取首字母(类名首字母大写), 并将首字母变为小写 - strategyName = strategyName.substring(0, 1).toLowerCase() + strategyName.substring(1); - operationMap.put(str, strategyName); - } - - /** - * 获取 - */ - public AbstractYkcStrategy getInvokeStrategy(String frameType) { - String s = operationMap.get(frameType); - return strategyMap.get(s); - } - - public static String getOperationMap() { - return JSON.toJSONString(operationMap); - } -}