package com.cico.nest.lcdp.boot.core.qxsd.infrastructure.gatewayimpl.mqtt.handler;

import com.cico.nest.lcdp.boot.core.qxsd.infrastructure.gatewayimpl.database.EventDetailMapper;
import com.cico.nest.lcdp.framework.mq.mqtt.core.annoations.MqttTopic;
import com.cico.nest.lcdp.framework.mq.mqtt.core.handler.MqttMessageHandler;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

/**
 * 全息隧道新事件上报隧道管控系统
 *topic = event/设备编码/videoEvent
 * @author rfx
 * @date 2024/11/17
 */

@Slf4j
@MqttTopic(topic = "event/qxsd/test",messageClass = TestSendHandler.class)
@Service
public class TestSendHandler implements MqttMessageHandler<TestSendHandler> {

    @Resource
    private EventDetailMapper eventDetailMapper;
    @Resource
    private StringRedisTemplate stringRedisTemplate;


    @Override
    public void handleText(TestSendHandler qxsdTrafficEventReport) {
        //不接收消息
    }

    /**
     * 上报交通事件消息
     * @param payload
     */
    @Override
    public void sendTo(Object payload) {
        log.info("发送mqtt消息体，{}",payload);
        MqttMessageHandler.super.sendTo(payload);
    }
}
