package com.loadCenter.aliyun.gateway.cache; import com.loadCenter.aliyun.gateway.cache.abs.GatewayNodeCacheAbs; import org.springframework.stereotype.Component; import java.util.List; /** * @ClassName GatewayNodeIDCache * @Description 节点id缓存 * @Author ZeJinG.Su * @Date 22:31 2024/4/19 */ @Component public class GatewayNodeIDCache extends GatewayNodeCacheAbs { private final static String gatewayLoadNodeIDKey = "NodeId"; @Override public String getPre() { return "gateway:load:"; } /** * 增加 * @param gatewayNodeIds */ public void put(List gatewayNodeIds) { this.remove(); redisService.setCacheList(encode(gatewayLoadNodeIDKey), gatewayNodeIds); } /** * 获取 * @return */ public List get() { return redisService.getCacheList(encode(gatewayLoadNodeIDKey)); } /** * 删除 */ public void remove() { redisService.deleteObject(encode(gatewayLoadNodeIDKey)); } }