From e6c81b3916494ef51edc21774a27402d0f16c49c Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期四, 24 八月 2023 17:21:04 +0800
Subject: [PATCH] plc配置支持serial和modbusTCP两种方式

---
 docs/docs.go |   39 +++++++++++++++++++++++++++++----------
 1 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/docs/docs.go b/docs/docs.go
index 13c6d5b..1f4a9ab 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -524,6 +524,17 @@
                 }
             }
         },
+        "constvar.PlcMethod": {
+            "type": "string",
+            "enum": [
+                "modbusTCP",
+                "serial"
+            ],
+            "x-enum-varnames": [
+                "PlcMethodModbusTCP",
+                "PlcMethodSerial"
+            ]
+        },
         "contextx.Response": {
             "type": "object",
             "properties": {
@@ -540,7 +551,12 @@
             "type": "object",
             "properties": {
                 "address": {
+                    "description": "PortName   string ` + "`" + `gorm:\"type:varchar(191);comment:绔彛鍚嶇О\" json:\"portName\"` + "`" + `\nFrequency  int    ` + "`" + `gorm:\"type:int(11);comment:鏁版嵁鏇存柊棰戠巼 0-瀹炴椂鏇存柊 1-1娆�/绉抃" json:\"frequency\"` + "`" + `",
                     "type": "string"
+                },
+                "baudRate": {
+                    "description": "涓插彛娉㈢壒鐜囷紝 method = serial鏃� 鐢�",
+                    "type": "integer"
                 },
                 "brand": {
                     "type": "string"
@@ -551,9 +567,6 @@
                         "$ref": "#/definitions/model.DevicePlcAddress"
                     }
                 },
-                "frequency": {
-                    "type": "integer"
-                },
                 "id": {
                     "type": "integer"
                 },
@@ -561,12 +574,14 @@
                     "type": "boolean"
                 },
                 "method": {
-                    "type": "string"
+                    "$ref": "#/definitions/constvar.PlcMethod"
                 },
                 "port": {
+                    "description": "plc 绔彛鍙凤紝  method =  modbusTCP鐢�",
                     "type": "integer"
                 },
-                "portName": {
+                "serialName": {
+                    "description": "涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�",
                     "type": "string"
                 }
             }
@@ -767,7 +782,12 @@
             "type": "object",
             "properties": {
                 "address": {
+                    "description": "PortName   string ` + "`" + `gorm:\"type:varchar(191);comment:绔彛鍚嶇О\" json:\"portName\"` + "`" + `\nFrequency  int    ` + "`" + `gorm:\"type:int(11);comment:鏁版嵁鏇存柊棰戠巼 0-瀹炴椂鏇存柊 1-1娆�/绉抃" json:\"frequency\"` + "`" + `",
                     "type": "string"
+                },
+                "baudRate": {
+                    "description": "涓插彛娉㈢壒鐜囷紝 method = serial鏃� 鐢�",
+                    "type": "integer"
                 },
                 "brand": {
                     "type": "string"
@@ -778,9 +798,6 @@
                         "$ref": "#/definitions/model.DevicePlcAddress"
                     }
                 },
-                "frequency": {
-                    "type": "integer"
-                },
                 "id": {
                     "type": "integer"
                 },
@@ -788,12 +805,14 @@
                     "type": "boolean"
                 },
                 "method": {
-                    "type": "string"
+                    "$ref": "#/definitions/constvar.PlcMethod"
                 },
                 "port": {
+                    "description": "plc 绔彛鍙凤紝  method =  modbusTCP鐢�",
                     "type": "integer"
                 },
-                "portName": {
+                "serialName": {
+                    "description": "涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�",
                     "type": "string"
                 }
             }

--
Gitblit v1.8.0