package net.vtstar.zhongtong.avi.monitoring.service;

import net.vtstar.zhongtong.avi.global.constant.Constant;
import net.vtstar.zhongtong.avi.monitoring.domain.Skid;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

@Service
public class SkidService {

    @Resource(name = "redisTemplate")
    protected HashOperations hashOperations;
    @Resource(name = "redisTemplate")
    protected ValueOperations valueOperations;


    public void boundSkid(String busNo,String skidNo){
        String skidName = Constant.SKID_PREFIX + skidNo;
        Skid skid = (Skid) valueOperations.get(skidName);
        skid.setBusNo(busNo);
        valueOperations.set(skidName,skid);
    }
}
