zxl
2026-03-20 ee8b4f41b25d510eda0b1c7ec553b73f6d7dd7e6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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);
    }
 
}