29 lines
542 B
Go
29 lines
542 B
Go
package route
|
|
|
|
import (
|
|
"datart/route/admin"
|
|
"datart/route/api"
|
|
"datart/route/ws"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func LoadRoute(engine *gin.Engine) {
|
|
engine.Use(gin.Recovery())
|
|
|
|
a := new(api.Api)
|
|
ga := engine.Group("api")
|
|
ga.POST("/alarm", a.PostUploadAlarm)
|
|
ga.GET("/points", a.GetPoints)
|
|
ga.GET("/events", a.GetEvents)
|
|
ga.POST("/events", a.PostUpsertEvents)
|
|
|
|
d := new(admin.Admin)
|
|
gd := engine.Group("admin")
|
|
gd.POST("/command", d.PostExecuteCommand)
|
|
|
|
w := new(ws.Ws)
|
|
gw := engine.Group("ws")
|
|
gw.GET("/104up", w.Cl104Up)
|
|
}
|