package main import ( "App_Warn/Nats" "App_Warn/Server" "github.com/gin-gonic/gin" ) func main() { Nats.NatsInit() bindAddress := "localhost:6211" r := gin.Default() r.GET("/ws", Server.WsHandle) // 测试 //go func() { // 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\",}")) // time.Sleep(time.Second * 3) // 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\",}")) //}() r.Run(bindAddress) }