package org.dromara.service.mqtt;

import lombok.extern.slf4j.Slf4j;
import net.dreamlu.iot.mqtt.spring.server.event.MqttClientOfflineEvent;
import net.dreamlu.iot.mqtt.spring.server.event.MqttClientOnlineEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class MqttConnectStatusListener {

    @EventListener
    public void online(MqttClientOnlineEvent event){
        log.info("客户端上线：{}",event.getClientId());
    }

    @EventListener
    public void offline(MqttClientOfflineEvent event) {
        log.info("MqttClientOfflineEvent:{}", event);
    }
}
