From fecd8ff508b33715cbe24ca892fc19a2d1ad1ef5 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期一, 06 十一月 2023 16:34:05 +0800
Subject: [PATCH] 加锁解决同时读串口时报的资源不可用和超时报错

---
 api/v1/plc.go |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/api/v1/plc.go b/api/v1/plc.go
index 14750bc..650f64b 100644
--- a/api/v1/plc.go
+++ b/api/v1/plc.go
@@ -19,7 +19,7 @@
 // @Tags      鐢熶骇鏁伴噺
 // @Summary   鑾峰彇鐢熶骇杩涘害
 // @Produce   application/json
-// @Param     object  body    request.SendProcessParams true  "鏌ヨ鍙傛暟"
+// @Param     object  body    request.GetProductProgress true  "鏌ヨ鍙傛暟"
 // @Success   200   {object}  contextx.Response{data=response.ProductProgress}  "鎴愬姛"
 // @Router    /v1/plc/productProgress [post]
 func (slf *PlcApi) GetProductProgress(c *gin.Context) {
@@ -46,6 +46,9 @@
 	}
 	resp.PlcStatus = plcStatus
 
+	resp.RealStartTime = service.TaskStartTimeGet(params.Channel)
+	resp.RealEndTime = service.TaskEndTimeGet(params.Channel)
+
 	ctx.OkWithDetailed(resp)
 }
 

--
Gitblit v1.8.0