main.go 709 B

1234567891011121314151617181920212223242526
  1. package main
  2. import (
  3. "App_Warn/Nats"
  4. "App_Warn/Server"
  5. "github.com/gin-gonic/gin"
  6. )
  7. func main() {
  8. Nats.NatsInit()
  9. bindAddress := "localhost:6211"
  10. r := gin.Default()
  11. r.GET("/ws", Server.WsHandle)
  12. // 测试
  13. //go func() {
  14. // println(Server.App_Warn_Sand("123333333333","{\"name1\":\"tttttt\",\"name2\":\"2023-01-18 17:27:40\",\"name3\":\"ttttttt\",\"name4\":\"yyyyyyyyyy\",\"T_T\":\"21.700000762939453\",\"T_RH\":\"41.5\",}"))
  15. // time.Sleep(time.Second * 3)
  16. // println(Server.App_Warn_Sand("123333333333","{\"name1\":\"tttttt\",\"name2\":\"2023-01-18 17:27:40\",\"name3\":\"ttttttt\",\"name4\":\"yyyyyyyyyy\",\"T_T\":\"21.700000762939453\",\"T_RH\":\"41.5\",}"))
  17. //}()
  18. r.Run(bindAddress)
  19. }