package iot.lidee.mq.producer;

import iot.lidee.common.core.mq.DeviceReportBo;
import iot.lidee.mqttclient.IEmqxMessageProducer;
import org.springframework.stereotype.Component;

/**
 * @author bill
 */
@Component
public class EmqxMessageProducer implements IEmqxMessageProducer {


    @Override
    public void sendEmqxMessage(String topicName, DeviceReportBo deviceReportBo) {
        if (topicName.contains("property/post")){
            MessageProducer.sendPublishMsg(deviceReportBo);
        } else {
            MessageProducer.sendOtherMsg(deviceReportBo);
        }
    }
}
