package com.junmp.jyzb.controller;

import com.junmp.jyzb.service.MqttGateWayService;
import com.junmp.jyzb.utils.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Create By Spring-2022/10/29
 */
@Controller
@RequestMapping(value = "/mqtt")
@Api(value = "MqttController", tags = {"MQTT 访问控制"})
public class MqttController {
//
//    @Autowired
//    private MqttGateWayService gateWay;
//
//    @RequestMapping(value = "/sendMqttSimple", method = RequestMethod.POST)
//    @ApiOperation("向指定主题中,发送消息")
//    @ResponseBody
//    public ResponseResult sendMqttSimple(@RequestParam(value = "topic", required = true) @ApiParam(value = "MQTT的主题") String topic, String data) {
//        try {
//            gateWay.sendMessageToMqtt(data, topic);
//            return new ResponseResult(99200,"操作成功",data);
//        } catch (Exception e) {
//
//        }
//        return new ResponseResult(99500,"操作失败");
//    }

}
