| | |
| | | "apsClient/conf" |
| | | _ "apsClient/docs" |
| | | "github.com/gin-contrib/cors" |
| | | "github.com/gin-contrib/pprof" |
| | | "github.com/gin-gonic/gin" |
| | | swaggerFiles "github.com/swaggo/files" |
| | | ginSwagger "github.com/swaggo/gin-swagger" |
| | |
| | | gin.SetMode(gin.ReleaseMode) |
| | | |
| | | Router := gin.Default() |
| | | |
| | | pprof.Register(Router) // 性能 |
| | | |
| | | Router.Use(gin.Recovery()) |
| | | if conf.Conf.System.Env == "develop" { |
| | | Router.Use(gin.Logger()) |
| | |
| | | deviceApi := new(v1.DeviceApi) |
| | | deviceGroup := v1Group.Group("device") |
| | | { |
| | | deviceGroup.GET("list", deviceApi.DeviceList) // 可选设备列表 |
| | | deviceGroup.GET("setCurrentDeviceId", deviceApi.SetCurrentDeviceId) // 切换设备ID |
| | | deviceGroup.GET("list", deviceApi.DeviceList) // 可选设备列表 |
| | | deviceGroup.POST("setCurrentDeviceId", deviceApi.SetCurrentDeviceId) // 切换设备ID |
| | | deviceGroup.POST("config", deviceApi.Config) // 配置一些字段 |
| | | } |
| | | |
| | | systemApi := new(v1.SystemApi) |
| | |
| | | systemGroup.GET("problemList", systemApi.ProblemList) // 问题诊断列表 |
| | | } |
| | | |
| | | reportWorkApi := new(v1.ReportWorkApi) |
| | | reportWorkGroup := v1Group.Group("reportWork") |
| | | { |
| | | reportWorkGroup.POST("report", reportWorkApi.Report) // 报工 |
| | | reportWorkGroup.GET("list", reportWorkApi.ReportList) // 报工列表 |
| | | } |
| | | |
| | | dashboardApi := new(v1.DashboardApi) |
| | | dashboardGroup := v1Group.Group("dashboard") |
| | | { |
| | | dashboardGroup.POST("dashboard", dashboardApi.Dashboard) //驾驶舱 |
| | | } |
| | | |
| | | //eventsApi := new(v1.EventsApi) |
| | | //eventsGroup := v1Group.Group("events") |
| | | //{ |