From 6a5ea3391fd6d87ee43f408a69d09f7d6128a064 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期一, 27 十一月 2023 16:43:08 +0800
Subject: [PATCH] 报工数据同步云端
---
api/v1/config.go | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/api/v1/config.go b/api/v1/config.go
index 267a041..ee22af0 100644
--- a/api/v1/config.go
+++ b/api/v1/config.go
@@ -125,12 +125,18 @@
return
}
+ params.DeviceID = conf.Conf.CurrentDeviceID
if params.Method == constvar.PlcMethodModbusTCP && (params.Address == "" || params.Port == 0) {
- ctx.FailWithMsg(ecode.ParamsErr, "褰撴帴鍙f柟寮忎负modbusTCP鏃讹紝address鍜宲ort涓嶈兘涓虹┖")
+ ctx.FailWithMsg(ecode.ParamsErr, "褰撴帴鍙f柟寮忎负modbusTCP鏃讹紝鍦板潃鍜岀鍙e彿涓嶈兘涓虹┖")
return
}
if params.Method == constvar.PlcMethodSerial && (params.BaudRate == 0 || params.SerialName == "") {
- ctx.FailWithMsg(ecode.ParamsErr, "褰撴帴鍙f柟寮忎负serial鏃讹紝baudRate鍜宻erialName涓嶈兘涓虹┖")
+ ctx.FailWithMsg(ecode.ParamsErr, "褰撴帴鍙f柟寮忎负serial鏃讹紝娉㈢壒鐜囧拰涓插彛鍚嶇О涓嶈兘涓虹┖")
+ return
+ }
+
+ if params.Method == constvar.PlcMethodModbusRTU && (params.DataBit == 0 || params.StopBit == 0 || params.Parity == 0) {
+ ctx.FailWithMsg(ecode.ParamsErr, "褰撴帴鍙f柟寮忎负modbusRTU鏃讹紝鏁版嵁浣嶏紝鍋滄浣嶏紝鏍¢獙浣嶄笉鑳戒负绌�")
return
}
--
Gitblit v1.8.0