package com.template.controller;

import com.template.service.MqttService;
import lombok.extern.log4j.Log4j2;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author：liuxinyue
 * @Package：com.template.controller
 * @Project：cloud-server
 * @name：MqttController
 * @Date：2024/9/26 15:44
 */
@Log4j2
@RestController
@RequestMapping("/mqtt")
public class MqttController {

    @Autowired
    private MqttService mqttService;


    @PostMapping("/connectionMqtt")
    public void connectionMqtt(@RequestParam("message") String message) throws MqttException {
        mqttService.connectionMqtt(message);
    }

}
