From 602d118cbe5d5a6910766c3e83208f09c0ba0bb6 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期四, 24 八月 2023 21:57:05 +0800
Subject: [PATCH] 增加设置生产总量接口

---
 docs/docs.go |  106 +++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 90 insertions(+), 16 deletions(-)

diff --git a/docs/docs.go b/docs/docs.go
index b074161..aaf2c50 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -158,7 +158,7 @@
                     "application/json"
                 ],
                 "tags": [
-                    "鑾峰彇鍔ㄦ�佹暟鎹�"
+                    "鐢熶骇鏁伴噺"
                 ],
                 "summary": "鑾峰彇鐢熶骇杩涘害",
                 "responses": {
@@ -178,6 +178,25 @@
                                     }
                                 }
                             ]
+                        }
+                    }
+                }
+            }
+        },
+        "/v1/plc/setProductNumber": {
+            "post": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "鐢熶骇鏁伴噺"
+                ],
+                "summary": "璁剧疆鐢熶骇鎬婚噺",
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "$ref": "#/definitions/contextx.Response"
                         }
                     }
                 }
@@ -490,6 +509,12 @@
                         "$ref": "#/definitions/common.ProcedureMaterial"
                     }
                 },
+                "nextProcedureId": {
+                    "type": "string"
+                },
+                "nextProcedureName": {
+                    "type": "string"
+                },
                 "outputMaterials": {
                     "description": "杈撳嚭鐗╂枡鍒楄〃",
                     "type": "array",
@@ -518,6 +543,39 @@
                 }
             }
         },
+        "constvar.PlcMethod": {
+            "type": "string",
+            "enum": [
+                "modbusTCP",
+                "serial"
+            ],
+            "x-enum-varnames": [
+                "PlcMethodModbusTCP",
+                "PlcMethodSerial"
+            ]
+        },
+        "constvar.PlcStartAddressType": {
+            "type": "integer",
+            "enum": [
+                1,
+                2
+            ],
+            "x-enum-varnames": [
+                "PlcStartAddressTypeFinishNumber",
+                "PlcStartAddressTypeTotalNumber"
+            ]
+        },
+        "constvar.PlcStartAddressValueType": {
+            "type": "string",
+            "enum": [
+                "string",
+                "int"
+            ],
+            "x-enum-varnames": [
+                "PlcStartAddressValueTypeString",
+                "PlcStartAddressValueTypeInt"
+            ]
+        },
         "contextx.Response": {
             "type": "object",
             "properties": {
@@ -534,7 +592,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"
@@ -545,9 +608,6 @@
                         "$ref": "#/definitions/model.DevicePlcAddress"
                     }
                 },
-                "frequency": {
-                    "type": "integer"
-                },
                 "id": {
                     "type": "integer"
                 },
@@ -555,12 +615,14 @@
                     "type": "boolean"
                 },
                 "method": {
-                    "type": "string"
+                    "$ref": "#/definitions/constvar.PlcMethod"
                 },
                 "port": {
+                    "description": "plc 绔彛鍙凤紝  method =  modbusTCP鐢�",
                     "type": "integer"
                 },
-                "portName": {
+                "serialName": {
+                    "description": "涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�",
                     "type": "string"
                 }
             }
@@ -570,7 +632,11 @@
             "properties": {
                 "fieldName": {
                     "description": "瀵瑰簲绯荤粺瀛楁",
-                    "type": "string"
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.PlcStartAddressType"
+                        }
+                    ]
                 },
                 "length": {
                     "description": "鏁版嵁闀垮害",
@@ -582,7 +648,11 @@
                 },
                 "type": {
                     "description": "鏁版嵁绫诲瀷",
-                    "type": "string"
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.PlcStartAddressValueType"
+                        }
+                    ]
                 }
             }
         },
@@ -761,7 +831,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"
@@ -772,9 +847,6 @@
                         "$ref": "#/definitions/model.DevicePlcAddress"
                     }
                 },
-                "frequency": {
-                    "type": "integer"
-                },
                 "id": {
                     "type": "integer"
                 },
@@ -782,12 +854,14 @@
                     "type": "boolean"
                 },
                 "method": {
-                    "type": "string"
+                    "$ref": "#/definitions/constvar.PlcMethod"
                 },
                 "port": {
+                    "description": "plc 绔彛鍙凤紝  method =  modbusTCP鐢�",
                     "type": "integer"
                 },
-                "portName": {
+                "serialName": {
+                    "description": "涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�",
                     "type": "string"
                 }
             }
@@ -846,6 +920,9 @@
             "properties": {
                 "finishNumber": {
                     "type": "integer"
+                },
+                "totalNumber": {
+                    "type": "integer"
                 }
             }
         },
@@ -857,9 +934,6 @@
                 },
                 "deviceStatus": {
                     "type": "string"
-                },
-                "nextProcedure": {
-                    "$ref": "#/definitions/model.Procedures"
                 },
                 "order": {
                     "$ref": "#/definitions/model.Order"

--
Gitblit v1.8.0