package com.tuoheng.admin.controller;

import com.tuoheng.common.core.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * 测试前端控制器
 *
 * @author wanjing
 * @team tuoheng
 * @date 2023-04-24
 */
@Slf4j
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private StringRedisTemplate redisTemplate;

    @PostMapping(value = "/webscoket/add")
    public void testWebSocketAdd() {

    }

    @PostMapping(value = "/webscoket/edit")
    public void testWebSocketEdit() {
    }

    @GetMapping("/mqtt")
    public JsonResult testMqtt() {
        String message = "Hello " + UUID.randomUUID();
        log.info("向MQTT推送消息，message={}", message);
        return JsonResult.success(message, "成功");
    }

}
