24 lines
450 B
Go
24 lines
450 B
Go
package route
|
|
|
|
import (
|
|
"datart/route/admin"
|
|
"datart/route/api"
|
|
|
|
"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)
|
|
}
|