package com.muyu.processing.consumer;

import com.muyu.enterprise.cache.FaultCacheService;
import com.muyu.enterprise.cache.FenceCahceService;
import com.muyu.enterprise.cache.VehicleCacheService;
import com.muyu.enterprise.cache.WarnRuleCacheService;
import com.muyu.processing.utils.CacheUtil;
import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 下线监听
 * @Author：杨鹏
 * @Package：com.muyu.processing.consumer
 * @Project：cloud-vehicle
 * @name：OfflineMonitoringConsumer
 * @Date：2024/10/4 14:48
 */
@Log4j2
@Component
public class OfflineMonitoringConsumer {

    @Resource
    private CacheUtil cacheUtil;





    /**
     * 接收消息
     * @param vin 车辆vin
     */
    @RabbitListener(queuesToDeclare = @Queue("offline_monitoring"))
    public void receive(String vin){
        log.info("清除缓存中的数据,车辆vin: {}", vin);
        // 清除缓存
        cacheUtil.remove(vin);
    }

}
