package com.tievd.jyz.mqtt;
|
|
import com.tievd.jyz.config.mqtt.MqttGateway;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* mqtt消息发送者
|
* @author timi
|
*/
|
@Component
|
public class MqttMsgSender {
|
@Autowired
|
private MqttGateway mqttGateway;
|
|
/**
|
* 发送消息
|
* @param data 发送内容
|
* @param topic 主题
|
*/
|
public void sendToMqtt(String data, String topic){
|
mqttGateway.sendToMqtt(data,topic);
|
}
|
|
}
|