From efec800478214f3a412f879d2b51c2968515995d Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期六, 25 十一月 2023 17:04:25 +0800 Subject: [PATCH] plc断开连接时获取工序最后一次报工数量作为加工数 --- router/index.go | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/router/index.go b/router/index.go index e0e357c..8375556 100644 --- a/router/index.go +++ b/router/index.go @@ -5,6 +5,7 @@ "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" @@ -15,6 +16,9 @@ gin.SetMode(gin.ReleaseMode) Router := gin.Default() + + pprof.Register(Router) // 鎬ц兘 + Router.Use(gin.Recovery()) if conf.Conf.System.Env == "develop" { Router.Use(gin.Logger()) @@ -71,8 +75,9 @@ 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) @@ -81,6 +86,13 @@ systemGroup.GET("problemList", systemApi.ProblemList) // 闂璇婃柇鍒楄〃 } + reportWorkApi := new(v1.ReportWorkApi) + reportWorkGroup := v1Group.Group("reportWork") + { + reportWorkGroup.POST("report", reportWorkApi.Report) // 鎶ュ伐 + reportWorkGroup.GET("list", reportWorkApi.ReportList) // 鎶ュ伐鍒楄〃 + } + //eventsApi := new(v1.EventsApi) //eventsGroup := v1Group.Group("events") //{ -- Gitblit v1.8.0