first-group-loadcenter/src/main/java/com/loadcenter/gateway/cache/GatewayNodeSetVinCache.java

35 lines
859 B
Java

package com.loadcenter.gateway.cache;
import com.loadcenter.gateway.cache.abs.GatewayCacheAbs;
import org.springframework.stereotype.Component;
/**
* @ClassName GatewayNodeSetVinCache
* @Description 一个节点对应多辆车的VIN
* @Author Can.J
* @Date 2024/4/19 9:49
*/
@Component
public class GatewayNodeSetVinCache extends GatewayCacheAbs<String> {
private final static String gatewayNodeSetVinCache ="cars:";
@Override
public String getPre() {
return "gateway:node:";
}
/**
* 节点添加vin
* @param node
* @param vin
*/
public void put(String node,String vin){
redisService.setCacheSet(encode(gatewayNodeSetVinCache)+node,vin);
}
public void remove(String nodeId,String vin){
redisService.deleteCacheSet(encode(gatewayNodeSetVinCache)+nodeId,vin);
}
}