package cn.gintone.controller;

import cn.gintone.iotdbUtils.IotDBUtil;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/testCon")
public class TestController {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @GetMapping("/testRabbit")
    public void testRabbit() {

        String message = "hellow spring boot topic message";
        rabbitTemplate.convertAndSend("my_boot_fanout_exchange", "product.delete", message);


    }

    @GetMapping("/testIotdb")
    public void testIotdb() {
        IotDBUtil.select();
    }
}
