From 74f8cd07a39795656573d4e4bb2fe85a6dadbb8c Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期六, 02 九月 2023 15:15:44 +0800
Subject: [PATCH] 从云端请求工艺参数,加入deviceId字段用于消息过滤

---
 docs/swagger.json |  291 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 268 insertions(+), 23 deletions(-)

diff --git a/docs/swagger.json b/docs/swagger.json
index d175615..d833d3b 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -4,7 +4,7 @@
         "contact": {}
     },
     "paths": {
-        "/v1/cc/nn": {
+        "/v1/config/net": {
             "get": {
                 "produces": [
                     "application/json"
@@ -37,7 +37,7 @@
                     }
                 }
             },
-            "put": {
+            "post": {
                 "produces": [
                     "application/json"
                 ],
@@ -81,7 +81,7 @@
                 }
             }
         },
-        "/v1/config/net": {
+        "/v1/config/plc": {
             "get": {
                 "produces": [
                     "application/json"
@@ -89,7 +89,7 @@
                 "tags": [
                     "Config"
                 ],
-                "summary": "鑾峰彇缃戠粶閰嶇疆",
+                "summary": "鑾峰彇plc閰嶇疆",
                 "responses": {
                     "200": {
                         "description": "鎴愬姛",
@@ -102,10 +102,7 @@
                                     "type": "object",
                                     "properties": {
                                         "data": {
-                                            "type": "array",
-                                            "items": {
-                                                "$ref": "#/definitions/model.NetConfig"
-                                            }
+                                            "$ref": "#/definitions/model.DevicePlc"
                                         }
                                     }
                                 }
@@ -114,25 +111,44 @@
                     }
                 }
             },
-            "put": {
+            "post": {
                 "produces": [
                     "application/json"
                 ],
                 "tags": [
                     "Config"
                 ],
-                "summary": "璁剧疆缃戠粶閰嶇疆",
+                "summary": "鏇存柊plc閰嶇疆",
                 "parameters": [
                     {
-                        "description": "鍙傛暟",
+                        "description": "鏌ヨ鍙傛暟",
                         "name": "object",
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "$ref": "#/definitions/model.NetConfig"
+                            "$ref": "#/definitions/request.UpdatePlc"
                         }
                     }
                 ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/contextx.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/v1/plc/productProgress": {
+            "get": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "鐢熶骇鏁伴噺"
+                ],
+                "summary": "鑾峰彇鐢熶骇杩涘害",
                 "responses": {
                     "200": {
                         "description": "鎴愬姛",
@@ -145,14 +161,30 @@
                                     "type": "object",
                                     "properties": {
                                         "data": {
-                                            "type": "array",
-                                            "items": {
-                                                "$ref": "#/definitions/response.ProcessParams"
-                                            }
+                                            "$ref": "#/definitions/response.ProductProgress"
                                         }
                                     }
                                 }
                             ]
+                        }
+                    }
+                }
+            }
+        },
+        "/v1/plc/setProductNumber": {
+            "post": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "鐢熶骇鏁伴噺"
+                ],
+                "summary": "璁剧疆鐢熶骇鎬婚噺",
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "$ref": "#/definitions/contextx.Response"
                         }
                     }
                 }
@@ -280,6 +312,37 @@
                 }
             }
         },
+        "/v1/task/countdown": {
+            "get": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "Task"
+                ],
+                "summary": "鏂颁换鍔″�掕鏃�",
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "allOf": [
+                                {
+                                    "$ref": "#/definitions/contextx.Response"
+                                },
+                                {
+                                    "type": "object",
+                                    "properties": {
+                                        "data": {
+                                            "$ref": "#/definitions/response.TaskCountdown"
+                                        }
+                                    }
+                                }
+                            ]
+                        }
+                    }
+                }
+            }
+        },
         "/v1/task/finish/{id}": {
             "put": {
                 "produces": [
@@ -397,10 +460,7 @@
                                     "type": "object",
                                     "properties": {
                                         "data": {
-                                            "type": "array",
-                                            "items": {
-                                                "$ref": "#/definitions/response.ProcessParams"
-                                            }
+                                            "$ref": "#/definitions/response.ProcessParamsResponse"
                                         }
                                     }
                                 }
@@ -468,6 +528,12 @@
                         "$ref": "#/definitions/common.ProcedureMaterial"
                     }
                 },
+                "nextProcedureId": {
+                    "type": "string"
+                },
+                "nextProcedureName": {
+                    "type": "string"
+                },
                 "outputMaterials": {
                     "description": "杈撳嚭鐗╂枡鍒楄〃",
                     "type": "array",
@@ -496,6 +562,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": {
@@ -505,6 +604,74 @@
                 "data": {},
                 "msg": {
                     "type": "string"
+                }
+            }
+        },
+        "model.DevicePlc": {
+            "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"
+                },
+                "details": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/model.DevicePlcAddress"
+                    }
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "isOpen": {
+                    "type": "boolean"
+                },
+                "method": {
+                    "$ref": "#/definitions/constvar.PlcMethod"
+                },
+                "port": {
+                    "description": "plc 绔彛鍙凤紝  method =  modbusTCP鐢�",
+                    "type": "integer"
+                },
+                "serialName": {
+                    "description": "涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�",
+                    "type": "string"
+                }
+            }
+        },
+        "model.DevicePlcAddress": {
+            "type": "object",
+            "properties": {
+                "fieldName": {
+                    "description": "瀵瑰簲绯荤粺瀛楁",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.PlcStartAddressType"
+                        }
+                    ]
+                },
+                "length": {
+                    "description": "鏁版嵁闀垮害",
+                    "type": "integer"
+                },
+                "startAddress": {
+                    "description": "鏁版嵁璧峰鍦板潃",
+                    "type": "integer"
+                },
+                "type": {
+                    "description": "鏁版嵁绫诲瀷",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.PlcStartAddressValueType"
+                        }
+                    ]
                 }
             }
         },
@@ -679,6 +846,45 @@
                 }
             }
         },
+        "request.UpdatePlc": {
+            "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"
+                },
+                "details": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/model.DevicePlcAddress"
+                    }
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "isOpen": {
+                    "type": "boolean"
+                },
+                "method": {
+                    "$ref": "#/definitions/constvar.PlcMethod"
+                },
+                "port": {
+                    "description": "plc 绔彛鍙凤紝  method =  modbusTCP鐢�",
+                    "type": "integer"
+                },
+                "serialName": {
+                    "description": "涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�",
+                    "type": "string"
+                }
+            }
+        },
         "request.UpdatePlcBrand": {
             "type": "object",
             "properties": {
@@ -714,6 +920,48 @@
                 "value": {}
             }
         },
+        "response.ProcessParamsResponse": {
+            "type": "object",
+            "properties": {
+                "number": {
+                    "type": "string"
+                },
+                "params": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/response.ProcessParams"
+                    }
+                }
+            }
+        },
+        "response.ProductProgress": {
+            "type": "object",
+            "properties": {
+                "finishNumber": {
+                    "type": "integer"
+                },
+                "totalNumber": {
+                    "type": "integer"
+                }
+            }
+        },
+        "response.TaskCountdown": {
+            "type": "object",
+            "properties": {
+                "countDownHour": {
+                    "description": "鍊掕鏃� 鏃�",
+                    "type": "integer"
+                },
+                "countDownMinute": {
+                    "description": "鍊掕鏃� 鍒�",
+                    "type": "integer"
+                },
+                "showCountDown": {
+                    "description": "鏄惁灞曠ず鍊掕鏃�",
+                    "type": "boolean"
+                }
+            }
+        },
         "response.TaskData": {
             "type": "object",
             "properties": {
@@ -722,9 +970,6 @@
                 },
                 "deviceStatus": {
                     "type": "string"
-                },
-                "nextProcedure": {
-                    "$ref": "#/definitions/model.Procedures"
                 },
                 "order": {
                     "$ref": "#/definitions/model.Order"

--
Gitblit v1.8.0