mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 19:45:09 +08:00
update
This commit is contained in:
@@ -16,6 +16,7 @@ import com.jsowell.thirdparty.lianlian.util.Encodes;
|
||||
import com.jsowell.thirdparty.lianlian.util.GBSignUtils;
|
||||
import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
|
||||
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -25,7 +26,7 @@ import java.util.Map;
|
||||
/**
|
||||
* 对接第三方平台抽象类
|
||||
*/
|
||||
public abstract class AbsInterfaceWithPlatformService {
|
||||
public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean {
|
||||
@Autowired
|
||||
protected PileStationInfoService pileStationInfoService;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.jsowell.thirdparty.platform;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 工厂设计模式
|
||||
* 对接第三方平台逻辑工厂类
|
||||
*/
|
||||
public class InterfaceWithPlatformLogicFactory {
|
||||
|
||||
private static final Map<String, AbsInterfaceWithPlatformLogic> platformMap = Maps.newHashMap();
|
||||
|
||||
/**
|
||||
* 注册
|
||||
* @param str
|
||||
* @param handler
|
||||
*/
|
||||
public static void register(String str, AbsInterfaceWithPlatformLogic handler) {
|
||||
if (StringUtils.isBlank(str) || Objects.isNull(handler)) {
|
||||
return;
|
||||
}
|
||||
platformMap.put(str, handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public static AbsInterfaceWithPlatformLogic getPlatformLogic(String name) {
|
||||
return platformMap.get(name);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user