From 803c72123fc14274c7a09f6eb0d6076d24afda3f Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期三, 01 十一月 2023 10:38:34 +0800
Subject: [PATCH] update doc

---
 docs/swagger.yaml |  245 +++++++++++++-
 docs/docs.go      |  371 +++++++++++++++++++-
 api/v1/task.go    |    4 
 docs/swagger.json |  371 +++++++++++++++++++-
 4 files changed, 900 insertions(+), 91 deletions(-)

diff --git a/api/v1/task.go b/api/v1/task.go
index d700a97..eadab62 100644
--- a/api/v1/task.go
+++ b/api/v1/task.go
@@ -418,8 +418,8 @@
 // @Tags      Task
 // @Summary   鑾峰彇浠诲姟鍒楄〃2
 // @Produce   application/json
-// @Param     object  query    request.SimpleTaskList true  "鏌ヨ鍙傛暟"
-// @Success   200   {object}  contextx.Response{data=map[int32]response.taskResponse}  "鎴愬姛"
+// @Param     object  query    request.TaskListByChannel true  "鏌ヨ鍙傛暟"
+// @Success   200   {object}  contextx.Response{data=map[int32]response.TaskResponse}  "鎴愬姛"
 // @Router    /v1/task/listByChannel [get]
 func (slf *TaskApi) TaskListByChannel(c *gin.Context) {
 	var params request.TaskListByChannel
diff --git a/docs/docs.go b/docs/docs.go
index 5868d78..6e7c7ed 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -152,6 +152,67 @@
                 }
             }
         },
+        "/v1/device/list": {
+            "post": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "Device"
+                ],
+                "summary": "鑾峰彇褰撳墠闈㈡澘缁戝畾鐨勮澶囧垪琛�",
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "allOf": [
+                                {
+                                    "$ref": "#/definitions/contextx.Response"
+                                },
+                                {
+                                    "type": "object",
+                                    "properties": {
+                                        "data": {
+                                            "$ref": "#/definitions/response.DeviceListResponse"
+                                        }
+                                    }
+                                }
+                            ]
+                        }
+                    }
+                }
+            }
+        },
+        "/v1/device/set": {
+            "post": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "璁惧"
+                ],
+                "summary": "璁剧疆褰撳墠璁惧id",
+                "parameters": [
+                    {
+                        "description": "鏌ヨ鍙傛暟",
+                        "name": "object",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/request.SetCurrentDevice"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "$ref": "#/definitions/contextx.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/v1/plc/productProgress": {
             "post": {
                 "produces": [
@@ -172,37 +233,6 @@
                         }
                     }
                 ],
-                "responses": {
-                    "200": {
-                        "description": "鎴愬姛",
-                        "schema": {
-                            "allOf": [
-                                {
-                                    "$ref": "#/definitions/contextx.Response"
-                                },
-                                {
-                                    "type": "object",
-                                    "properties": {
-                                        "data": {
-                                            "$ref": "#/definitions/response.ProductProgress"
-                                        }
-                                    }
-                                }
-                            ]
-                        }
-                    }
-                }
-            }
-        },
-        "/v1/plc/productProgressRealTime": {
-            "post": {
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "鐢熶骇鏁伴噺"
-                ],
-                "summary": "瀹炴椂鑾峰彇鐢熶骇杩涘害",
                 "responses": {
                     "200": {
                         "description": "鎴愬姛",
@@ -498,6 +528,11 @@
                 "summary": "鑾峰彇浠诲姟",
                 "parameters": [
                     {
+                        "type": "string",
+                        "name": "deviceID",
+                        "in": "query"
+                    },
+                    {
                         "type": "integer",
                         "description": "椤电爜",
                         "name": "page",
@@ -543,6 +578,81 @@
                                     "properties": {
                                         "data": {
                                             "$ref": "#/definitions/response.TaskResponse"
+                                        }
+                                    }
+                                }
+                            ]
+                        }
+                    }
+                }
+            }
+        },
+        "/v1/task/listByChannel": {
+            "get": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "Task"
+                ],
+                "summary": "鑾峰彇浠诲姟鍒楄〃2",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "閫氶亾鍙枫�備笉浼犲彇鍏ㄩ儴鐨�",
+                        "name": "channel",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "name": "deviceID",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "榛樿3",
+                        "name": "limit",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "榛樿0",
+                        "name": "offset",
+                        "in": "query"
+                    },
+                    {
+                        "enum": [
+                            1,
+                            2,
+                            3
+                        ],
+                        "type": "integer",
+                        "x-enum-varnames": [
+                            "QueryTypeUnFinish",
+                            "QueryTypeToday",
+                            "QueryTypeFinished"
+                        ],
+                        "description": "1 鏈畬鎴� 2 浠婂ぉ鏈畬鎴� 3 宸插畬鎴�",
+                        "name": "type",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "allOf": [
+                                {
+                                    "$ref": "#/definitions/contextx.Response"
+                                },
+                                {
+                                    "type": "object",
+                                    "properties": {
+                                        "data": {
+                                            "type": "object",
+                                            "additionalProperties": {
+                                                "$ref": "#/definitions/response.TaskResponse"
+                                            }
                                         }
                                     }
                                 }
@@ -766,16 +876,36 @@
                 }
             }
         },
+        "constvar.Parity": {
+            "type": "integer",
+            "enum": [
+                1,
+                2,
+                3
+            ],
+            "x-enum-comments": {
+                "ParityEven": "濂囨牎楠�",
+                "ParityNull": "鏃犳牎楠�",
+                "ParityOdd": "鍋舵牎楠�"
+            },
+            "x-enum-varnames": [
+                "ParityEven",
+                "ParityOdd",
+                "ParityNull"
+            ]
+        },
         "constvar.PlcMethod": {
             "type": "string",
             "enum": [
                 "modbusTCP",
+                "modbusRTU",
                 "serial",
                 "缃戠粶",
                 "涓插彛"
             ],
             "x-enum-varnames": [
                 "PlcMethodModbusTCP",
+                "PlcMethodModbusRTU",
                 "PlcMethodSerial",
                 "PlcMethodModbusTCPChinese",
                 "PlcMethodSerialChinese"
@@ -837,7 +967,7 @@
             "type": "object",
             "properties": {
                 "address": {
-                    "description": "PortName   string ` + "`" + `gorm:\"type:varchar(191);comment:绔彛鍚嶇О\" json:\"portName\"` + "`" + `\nFrequency  int    ` + "`" + `gorm:\"comment:鏁版嵁鏇存柊棰戠巼 0-瀹炴椂鏇存柊 1-1娆�/绉抃" json:\"frequency\"` + "`" + `",
+                    "description": "plc ip鍦板潃锛� method = modbusTCP鐢�",
                     "type": "string"
                 },
                 "baudRate": {
@@ -847,11 +977,25 @@
                 "brand": {
                     "type": "string"
                 },
+                "createdAt": {
+                    "type": "string"
+                },
+                "dataBit": {
+                    "description": "鏁版嵁浣嶏紝method = modbusRTU 鐢�",
+                    "type": "integer"
+                },
+                "deletedAt": {
+                    "type": "string"
+                },
                 "details": {
                     "type": "array",
                     "items": {
                         "$ref": "#/definitions/model.DevicePlcAddress"
                     }
+                },
+                "deviceID": {
+                    "description": "璁惧缂栧彿",
+                    "type": "string"
                 },
                 "id": {
                     "type": "integer"
@@ -862,12 +1006,27 @@
                 "method": {
                     "$ref": "#/definitions/constvar.PlcMethod"
                 },
+                "parity": {
+                    "description": "鏍¢獙鏂瑰紡锛宮ethod = modbusRTU 鐢�",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.Parity"
+                        }
+                    ]
+                },
                 "port": {
                     "description": "plc 绔彛鍙凤紝  method =  modbusTCP鐢�",
                     "type": "integer"
                 },
                 "serialName": {
                     "description": "涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�",
+                    "type": "string"
+                },
+                "stopBit": {
+                    "description": "鍋滄浣嶏紝method = modbusRTU 鐢�",
+                    "type": "integer"
+                },
+                "updatedAt": {
                     "type": "string"
                 }
             }
@@ -914,6 +1073,12 @@
                 "networkCard"
             ],
             "properties": {
+                "createdAt": {
+                    "type": "string"
+                },
+                "deletedAt": {
+                    "type": "string"
+                },
                 "dns": {
                     "description": "dns",
                     "type": "string"
@@ -944,6 +1109,9 @@
                             "$ref": "#/definitions/model.NetConfigStatus"
                         }
                     ]
+                },
+                "updatedAt": {
+                    "type": "string"
                 }
             }
         },
@@ -968,13 +1136,22 @@
                 "amount": {
                     "type": "number"
                 },
+                "createdAt": {
+                    "type": "string"
+                },
                 "customer": {
+                    "type": "string"
+                },
+                "deletedAt": {
                     "type": "string"
                 },
                 "deliverDate": {
                     "type": "string"
                 },
                 "endTime": {
+                    "type": "integer"
+                },
+                "id": {
                     "type": "integer"
                 },
                 "orderAttr": {
@@ -1002,6 +1179,9 @@
                 "unit": {
                     "type": "string"
                 },
+                "updatedAt": {
+                    "type": "string"
+                },
                 "workOrderId": {
                     "type": "string"
                 }
@@ -1023,10 +1203,19 @@
         "model.PlcBrand": {
             "type": "object",
             "properties": {
+                "createdAt": {
+                    "type": "string"
+                },
+                "deletedAt": {
+                    "type": "string"
+                },
                 "id": {
                     "type": "integer"
                 },
                 "name": {
+                    "type": "string"
+                },
+                "updatedAt": {
                     "type": "string"
                 }
             }
@@ -1050,6 +1239,12 @@
                 "channel": {
                     "description": "閫氶亾",
                     "type": "integer"
+                },
+                "createdAt": {
+                    "type": "string"
+                },
+                "deletedAt": {
+                    "type": "string"
                 },
                 "deviceId": {
                     "type": "string"
@@ -1075,20 +1270,38 @@
                     "description": "宸ヨ壓妯″瀷缂栧彿",
                     "type": "string"
                 },
+                "realEndTime": {
+                    "type": "integer"
+                },
+                "realStartTime": {
+                    "type": "integer"
+                },
                 "startTime": {
                     "type": "integer"
                 },
                 "status": {
                     "$ref": "#/definitions/model.ProcedureStatus"
+                },
+                "updatedAt": {
+                    "type": "string"
                 }
             }
         },
         "model.ProcessModel": {
             "type": "object",
             "properties": {
+                "createdAt": {
+                    "type": "string"
+                },
+                "deletedAt": {
+                    "type": "string"
+                },
                 "deviceId": {
                     "description": "鐢ㄤ簬杩囨护鑾峰彇nsq娑堟伅",
                     "type": "string"
+                },
+                "id": {
+                    "type": "integer"
                 },
                 "isUpdate": {
                     "description": "鍓嶇鐢�",
@@ -1119,19 +1332,44 @@
                 "product": {
                     "description": "浜у搧鍚嶇О",
                     "type": "string"
+                },
+                "updatedAt": {
+                    "type": "string"
                 }
             }
         },
         "request.AddPlcBrand": {
             "type": "object",
             "properties": {
+                "createdAt": {
+                    "type": "string"
+                },
+                "deletedAt": {
+                    "type": "string"
+                },
                 "id": {
                     "type": "integer"
                 },
                 "name": {
                     "type": "string"
+                },
+                "updatedAt": {
+                    "type": "string"
                 }
             }
+        },
+        "request.QueryType": {
+            "type": "integer",
+            "enum": [
+                1,
+                2,
+                3
+            ],
+            "x-enum-varnames": [
+                "QueryTypeUnFinish",
+                "QueryTypeToday",
+                "QueryTypeFinished"
+            ]
         },
         "request.SendProcessParams": {
             "type": "object",
@@ -1144,11 +1382,20 @@
                 }
             }
         },
+        "request.SetCurrentDevice": {
+            "type": "object",
+            "properties": {
+                "currentDeviceID": {
+                    "description": "褰撳墠閫夊畾鐨勭敓浜ц澶�",
+                    "type": "string"
+                }
+            }
+        },
         "request.UpdatePlc": {
             "type": "object",
             "properties": {
                 "address": {
-                    "description": "PortName   string ` + "`" + `gorm:\"type:varchar(191);comment:绔彛鍚嶇О\" json:\"portName\"` + "`" + `\nFrequency  int    ` + "`" + `gorm:\"comment:鏁版嵁鏇存柊棰戠巼 0-瀹炴椂鏇存柊 1-1娆�/绉抃" json:\"frequency\"` + "`" + `",
+                    "description": "plc ip鍦板潃锛� method = modbusTCP鐢�",
                     "type": "string"
                 },
                 "baudRate": {
@@ -1158,11 +1405,25 @@
                 "brand": {
                     "type": "string"
                 },
+                "createdAt": {
+                    "type": "string"
+                },
+                "dataBit": {
+                    "description": "鏁版嵁浣嶏紝method = modbusRTU 鐢�",
+                    "type": "integer"
+                },
+                "deletedAt": {
+                    "type": "string"
+                },
                 "details": {
                     "type": "array",
                     "items": {
                         "$ref": "#/definitions/model.DevicePlcAddress"
                     }
+                },
+                "deviceID": {
+                    "description": "璁惧缂栧彿",
+                    "type": "string"
                 },
                 "id": {
                     "type": "integer"
@@ -1173,6 +1434,14 @@
                 "method": {
                     "$ref": "#/definitions/constvar.PlcMethod"
                 },
+                "parity": {
+                    "description": "鏍¢獙鏂瑰紡锛宮ethod = modbusRTU 鐢�",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.Parity"
+                        }
+                    ]
+                },
                 "port": {
                     "description": "plc 绔彛鍙凤紝  method =  modbusTCP鐢�",
                     "type": "integer"
@@ -1180,17 +1449,53 @@
                 "serialName": {
                     "description": "涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�",
                     "type": "string"
+                },
+                "stopBit": {
+                    "description": "鍋滄浣嶏紝method = modbusRTU 鐢�",
+                    "type": "integer"
+                },
+                "updatedAt": {
+                    "type": "string"
                 }
             }
         },
         "request.UpdatePlcBrand": {
             "type": "object",
             "properties": {
+                "createdAt": {
+                    "type": "string"
+                },
+                "deletedAt": {
+                    "type": "string"
+                },
                 "id": {
                     "type": "integer"
                 },
                 "name": {
                     "type": "string"
+                },
+                "updatedAt": {
+                    "type": "string"
+                }
+            }
+        },
+        "response.DeviceListResponse": {
+            "type": "object",
+            "properties": {
+                "currentDeviceID": {
+                    "description": "褰撳墠閫夊畾鐨勭敓浜ц澶�",
+                    "type": "string"
+                },
+                "deviceIDList": {
+                    "description": "鐢熶骇璁惧id鍒楄〃",
+                    "type": "array",
+                    "items": {
+                        "type": "string"
+                    }
+                },
+                "systemDeviceID": {
+                    "description": "宸ユ帶鏈鸿澶嘔D",
+                    "type": "string"
                 }
             }
         },
diff --git a/docs/swagger.json b/docs/swagger.json
index 39f51a6..98ed7bf 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -140,6 +140,67 @@
                 }
             }
         },
+        "/v1/device/list": {
+            "post": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "Device"
+                ],
+                "summary": "鑾峰彇褰撳墠闈㈡澘缁戝畾鐨勮澶囧垪琛�",
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "allOf": [
+                                {
+                                    "$ref": "#/definitions/contextx.Response"
+                                },
+                                {
+                                    "type": "object",
+                                    "properties": {
+                                        "data": {
+                                            "$ref": "#/definitions/response.DeviceListResponse"
+                                        }
+                                    }
+                                }
+                            ]
+                        }
+                    }
+                }
+            }
+        },
+        "/v1/device/set": {
+            "post": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "璁惧"
+                ],
+                "summary": "璁剧疆褰撳墠璁惧id",
+                "parameters": [
+                    {
+                        "description": "鏌ヨ鍙傛暟",
+                        "name": "object",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/request.SetCurrentDevice"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "$ref": "#/definitions/contextx.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/v1/plc/productProgress": {
             "post": {
                 "produces": [
@@ -160,37 +221,6 @@
                         }
                     }
                 ],
-                "responses": {
-                    "200": {
-                        "description": "鎴愬姛",
-                        "schema": {
-                            "allOf": [
-                                {
-                                    "$ref": "#/definitions/contextx.Response"
-                                },
-                                {
-                                    "type": "object",
-                                    "properties": {
-                                        "data": {
-                                            "$ref": "#/definitions/response.ProductProgress"
-                                        }
-                                    }
-                                }
-                            ]
-                        }
-                    }
-                }
-            }
-        },
-        "/v1/plc/productProgressRealTime": {
-            "post": {
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "鐢熶骇鏁伴噺"
-                ],
-                "summary": "瀹炴椂鑾峰彇鐢熶骇杩涘害",
                 "responses": {
                     "200": {
                         "description": "鎴愬姛",
@@ -486,6 +516,11 @@
                 "summary": "鑾峰彇浠诲姟",
                 "parameters": [
                     {
+                        "type": "string",
+                        "name": "deviceID",
+                        "in": "query"
+                    },
+                    {
                         "type": "integer",
                         "description": "椤电爜",
                         "name": "page",
@@ -531,6 +566,81 @@
                                     "properties": {
                                         "data": {
                                             "$ref": "#/definitions/response.TaskResponse"
+                                        }
+                                    }
+                                }
+                            ]
+                        }
+                    }
+                }
+            }
+        },
+        "/v1/task/listByChannel": {
+            "get": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "Task"
+                ],
+                "summary": "鑾峰彇浠诲姟鍒楄〃2",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "閫氶亾鍙枫�備笉浼犲彇鍏ㄩ儴鐨�",
+                        "name": "channel",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "name": "deviceID",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "榛樿3",
+                        "name": "limit",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "榛樿0",
+                        "name": "offset",
+                        "in": "query"
+                    },
+                    {
+                        "enum": [
+                            1,
+                            2,
+                            3
+                        ],
+                        "type": "integer",
+                        "x-enum-varnames": [
+                            "QueryTypeUnFinish",
+                            "QueryTypeToday",
+                            "QueryTypeFinished"
+                        ],
+                        "description": "1 鏈畬鎴� 2 浠婂ぉ鏈畬鎴� 3 宸插畬鎴�",
+                        "name": "type",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "allOf": [
+                                {
+                                    "$ref": "#/definitions/contextx.Response"
+                                },
+                                {
+                                    "type": "object",
+                                    "properties": {
+                                        "data": {
+                                            "type": "object",
+                                            "additionalProperties": {
+                                                "$ref": "#/definitions/response.TaskResponse"
+                                            }
                                         }
                                     }
                                 }
@@ -754,16 +864,36 @@
                 }
             }
         },
+        "constvar.Parity": {
+            "type": "integer",
+            "enum": [
+                1,
+                2,
+                3
+            ],
+            "x-enum-comments": {
+                "ParityEven": "濂囨牎楠�",
+                "ParityNull": "鏃犳牎楠�",
+                "ParityOdd": "鍋舵牎楠�"
+            },
+            "x-enum-varnames": [
+                "ParityEven",
+                "ParityOdd",
+                "ParityNull"
+            ]
+        },
         "constvar.PlcMethod": {
             "type": "string",
             "enum": [
                 "modbusTCP",
+                "modbusRTU",
                 "serial",
                 "缃戠粶",
                 "涓插彛"
             ],
             "x-enum-varnames": [
                 "PlcMethodModbusTCP",
+                "PlcMethodModbusRTU",
                 "PlcMethodSerial",
                 "PlcMethodModbusTCPChinese",
                 "PlcMethodSerialChinese"
@@ -825,7 +955,7 @@
             "type": "object",
             "properties": {
                 "address": {
-                    "description": "PortName   string `gorm:\"type:varchar(191);comment:绔彛鍚嶇О\" json:\"portName\"`\nFrequency  int    `gorm:\"comment:鏁版嵁鏇存柊棰戠巼 0-瀹炴椂鏇存柊 1-1娆�/绉抃" json:\"frequency\"`",
+                    "description": "plc ip鍦板潃锛� method = modbusTCP鐢�",
                     "type": "string"
                 },
                 "baudRate": {
@@ -835,11 +965,25 @@
                 "brand": {
                     "type": "string"
                 },
+                "createdAt": {
+                    "type": "string"
+                },
+                "dataBit": {
+                    "description": "鏁版嵁浣嶏紝method = modbusRTU 鐢�",
+                    "type": "integer"
+                },
+                "deletedAt": {
+                    "type": "string"
+                },
                 "details": {
                     "type": "array",
                     "items": {
                         "$ref": "#/definitions/model.DevicePlcAddress"
                     }
+                },
+                "deviceID": {
+                    "description": "璁惧缂栧彿",
+                    "type": "string"
                 },
                 "id": {
                     "type": "integer"
@@ -850,12 +994,27 @@
                 "method": {
                     "$ref": "#/definitions/constvar.PlcMethod"
                 },
+                "parity": {
+                    "description": "鏍¢獙鏂瑰紡锛宮ethod = modbusRTU 鐢�",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.Parity"
+                        }
+                    ]
+                },
                 "port": {
                     "description": "plc 绔彛鍙凤紝  method =  modbusTCP鐢�",
                     "type": "integer"
                 },
                 "serialName": {
                     "description": "涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�",
+                    "type": "string"
+                },
+                "stopBit": {
+                    "description": "鍋滄浣嶏紝method = modbusRTU 鐢�",
+                    "type": "integer"
+                },
+                "updatedAt": {
                     "type": "string"
                 }
             }
@@ -902,6 +1061,12 @@
                 "networkCard"
             ],
             "properties": {
+                "createdAt": {
+                    "type": "string"
+                },
+                "deletedAt": {
+                    "type": "string"
+                },
                 "dns": {
                     "description": "dns",
                     "type": "string"
@@ -932,6 +1097,9 @@
                             "$ref": "#/definitions/model.NetConfigStatus"
                         }
                     ]
+                },
+                "updatedAt": {
+                    "type": "string"
                 }
             }
         },
@@ -956,13 +1124,22 @@
                 "amount": {
                     "type": "number"
                 },
+                "createdAt": {
+                    "type": "string"
+                },
                 "customer": {
+                    "type": "string"
+                },
+                "deletedAt": {
                     "type": "string"
                 },
                 "deliverDate": {
                     "type": "string"
                 },
                 "endTime": {
+                    "type": "integer"
+                },
+                "id": {
                     "type": "integer"
                 },
                 "orderAttr": {
@@ -990,6 +1167,9 @@
                 "unit": {
                     "type": "string"
                 },
+                "updatedAt": {
+                    "type": "string"
+                },
                 "workOrderId": {
                     "type": "string"
                 }
@@ -1011,10 +1191,19 @@
         "model.PlcBrand": {
             "type": "object",
             "properties": {
+                "createdAt": {
+                    "type": "string"
+                },
+                "deletedAt": {
+                    "type": "string"
+                },
                 "id": {
                     "type": "integer"
                 },
                 "name": {
+                    "type": "string"
+                },
+                "updatedAt": {
                     "type": "string"
                 }
             }
@@ -1038,6 +1227,12 @@
                 "channel": {
                     "description": "閫氶亾",
                     "type": "integer"
+                },
+                "createdAt": {
+                    "type": "string"
+                },
+                "deletedAt": {
+                    "type": "string"
                 },
                 "deviceId": {
                     "type": "string"
@@ -1063,20 +1258,38 @@
                     "description": "宸ヨ壓妯″瀷缂栧彿",
                     "type": "string"
                 },
+                "realEndTime": {
+                    "type": "integer"
+                },
+                "realStartTime": {
+                    "type": "integer"
+                },
                 "startTime": {
                     "type": "integer"
                 },
                 "status": {
                     "$ref": "#/definitions/model.ProcedureStatus"
+                },
+                "updatedAt": {
+                    "type": "string"
                 }
             }
         },
         "model.ProcessModel": {
             "type": "object",
             "properties": {
+                "createdAt": {
+                    "type": "string"
+                },
+                "deletedAt": {
+                    "type": "string"
+                },
                 "deviceId": {
                     "description": "鐢ㄤ簬杩囨护鑾峰彇nsq娑堟伅",
                     "type": "string"
+                },
+                "id": {
+                    "type": "integer"
                 },
                 "isUpdate": {
                     "description": "鍓嶇鐢�",
@@ -1107,19 +1320,44 @@
                 "product": {
                     "description": "浜у搧鍚嶇О",
                     "type": "string"
+                },
+                "updatedAt": {
+                    "type": "string"
                 }
             }
         },
         "request.AddPlcBrand": {
             "type": "object",
             "properties": {
+                "createdAt": {
+                    "type": "string"
+                },
+                "deletedAt": {
+                    "type": "string"
+                },
                 "id": {
                     "type": "integer"
                 },
                 "name": {
                     "type": "string"
+                },
+                "updatedAt": {
+                    "type": "string"
                 }
             }
+        },
+        "request.QueryType": {
+            "type": "integer",
+            "enum": [
+                1,
+                2,
+                3
+            ],
+            "x-enum-varnames": [
+                "QueryTypeUnFinish",
+                "QueryTypeToday",
+                "QueryTypeFinished"
+            ]
         },
         "request.SendProcessParams": {
             "type": "object",
@@ -1132,11 +1370,20 @@
                 }
             }
         },
+        "request.SetCurrentDevice": {
+            "type": "object",
+            "properties": {
+                "currentDeviceID": {
+                    "description": "褰撳墠閫夊畾鐨勭敓浜ц澶�",
+                    "type": "string"
+                }
+            }
+        },
         "request.UpdatePlc": {
             "type": "object",
             "properties": {
                 "address": {
-                    "description": "PortName   string `gorm:\"type:varchar(191);comment:绔彛鍚嶇О\" json:\"portName\"`\nFrequency  int    `gorm:\"comment:鏁版嵁鏇存柊棰戠巼 0-瀹炴椂鏇存柊 1-1娆�/绉抃" json:\"frequency\"`",
+                    "description": "plc ip鍦板潃锛� method = modbusTCP鐢�",
                     "type": "string"
                 },
                 "baudRate": {
@@ -1146,11 +1393,25 @@
                 "brand": {
                     "type": "string"
                 },
+                "createdAt": {
+                    "type": "string"
+                },
+                "dataBit": {
+                    "description": "鏁版嵁浣嶏紝method = modbusRTU 鐢�",
+                    "type": "integer"
+                },
+                "deletedAt": {
+                    "type": "string"
+                },
                 "details": {
                     "type": "array",
                     "items": {
                         "$ref": "#/definitions/model.DevicePlcAddress"
                     }
+                },
+                "deviceID": {
+                    "description": "璁惧缂栧彿",
+                    "type": "string"
                 },
                 "id": {
                     "type": "integer"
@@ -1161,6 +1422,14 @@
                 "method": {
                     "$ref": "#/definitions/constvar.PlcMethod"
                 },
+                "parity": {
+                    "description": "鏍¢獙鏂瑰紡锛宮ethod = modbusRTU 鐢�",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.Parity"
+                        }
+                    ]
+                },
                 "port": {
                     "description": "plc 绔彛鍙凤紝  method =  modbusTCP鐢�",
                     "type": "integer"
@@ -1168,17 +1437,53 @@
                 "serialName": {
                     "description": "涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�",
                     "type": "string"
+                },
+                "stopBit": {
+                    "description": "鍋滄浣嶏紝method = modbusRTU 鐢�",
+                    "type": "integer"
+                },
+                "updatedAt": {
+                    "type": "string"
                 }
             }
         },
         "request.UpdatePlcBrand": {
             "type": "object",
             "properties": {
+                "createdAt": {
+                    "type": "string"
+                },
+                "deletedAt": {
+                    "type": "string"
+                },
                 "id": {
                     "type": "integer"
                 },
                 "name": {
                     "type": "string"
+                },
+                "updatedAt": {
+                    "type": "string"
+                }
+            }
+        },
+        "response.DeviceListResponse": {
+            "type": "object",
+            "properties": {
+                "currentDeviceID": {
+                    "description": "褰撳墠閫夊畾鐨勭敓浜ц澶�",
+                    "type": "string"
+                },
+                "deviceIDList": {
+                    "description": "鐢熶骇璁惧id鍒楄〃",
+                    "type": "array",
+                    "items": {
+                        "type": "string"
+                    }
+                },
+                "systemDeviceID": {
+                    "description": "宸ユ帶鏈鸿澶嘔D",
+                    "type": "string"
                 }
             }
         },
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index e17229c..c2bc840 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -74,15 +74,31 @@
       safeProduce:
         type: string
     type: object
+  constvar.Parity:
+    enum:
+    - 1
+    - 2
+    - 3
+    type: integer
+    x-enum-comments:
+      ParityEven: 濂囨牎楠�
+      ParityNull: 鏃犳牎楠�
+      ParityOdd: 鍋舵牎楠�
+    x-enum-varnames:
+    - ParityEven
+    - ParityOdd
+    - ParityNull
   constvar.PlcMethod:
     enum:
     - modbusTCP
+    - modbusRTU
     - serial
     - 缃戠粶
     - 涓插彛
     type: string
     x-enum-varnames:
     - PlcMethodModbusTCP
+    - PlcMethodModbusRTU
     - PlcMethodSerial
     - PlcMethodModbusTCPChinese
     - PlcMethodSerialChinese
@@ -127,30 +143,47 @@
   model.DevicePlc:
     properties:
       address:
-        description: |-
-          PortName   string `gorm:"type:varchar(191);comment:绔彛鍚嶇О" json:"portName"`
-          Frequency  int    `gorm:"comment:鏁版嵁鏇存柊棰戠巼 0-瀹炴椂鏇存柊 1-1娆�/绉�" json:"frequency"`
+        description: plc ip鍦板潃锛� method = modbusTCP鐢�
         type: string
       baudRate:
         description: 涓插彛娉㈢壒鐜囷紝 method = serial鏃� 鐢�
         type: integer
       brand:
         type: string
+      createdAt:
+        type: string
+      dataBit:
+        description: 鏁版嵁浣嶏紝method = modbusRTU 鐢�
+        type: integer
+      deletedAt:
+        type: string
       details:
         items:
           $ref: '#/definitions/model.DevicePlcAddress'
         type: array
+      deviceID:
+        description: 璁惧缂栧彿
+        type: string
       id:
         type: integer
       isOpen:
         type: boolean
       method:
         $ref: '#/definitions/constvar.PlcMethod'
+      parity:
+        allOf:
+        - $ref: '#/definitions/constvar.Parity'
+        description: 鏍¢獙鏂瑰紡锛宮ethod = modbusRTU 鐢�
       port:
         description: plc 绔彛鍙凤紝  method =  modbusTCP鐢�
         type: integer
       serialName:
         description: 涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�
+        type: string
+      stopBit:
+        description: 鍋滄浣嶏紝method = modbusRTU 鐢�
+        type: integer
+      updatedAt:
         type: string
     type: object
   model.DevicePlcAddress:
@@ -175,6 +208,10 @@
     type: object
   model.NetConfig:
     properties:
+      createdAt:
+        type: string
+      deletedAt:
+        type: string
       dns:
         description: dns
         type: string
@@ -196,6 +233,8 @@
         allOf:
         - $ref: '#/definitions/model.NetConfigStatus'
         description: 鐘舵�侊紙1鍚敤2绂佺敤锛�
+      updatedAt:
+        type: string
     required:
     - gateway
     - ip
@@ -217,11 +256,17 @@
     properties:
       amount:
         type: number
+      createdAt:
+        type: string
       customer:
+        type: string
+      deletedAt:
         type: string
       deliverDate:
         type: string
       endTime:
+        type: integer
+      id:
         type: integer
       orderAttr:
         description: 璁㈠崟灞炴�ф嫾鎺ョ殑瀛楃涓诧紝鍗宠揣鐗╂弿杩�
@@ -240,6 +285,8 @@
         $ref: '#/definitions/model.OrderStatus'
       unit:
         type: string
+      updatedAt:
+        type: string
       workOrderId:
         type: string
     type: object
@@ -255,9 +302,15 @@
     - OrderStatusFinished
   model.PlcBrand:
     properties:
+      createdAt:
+        type: string
+      deletedAt:
+        type: string
       id:
         type: integer
       name:
+        type: string
+      updatedAt:
         type: string
     type: object
   model.ProcedureStatus:
@@ -275,6 +328,10 @@
       channel:
         description: 閫氶亾
         type: integer
+      createdAt:
+        type: string
+      deletedAt:
+        type: string
       deviceId:
         type: string
       endTime:
@@ -290,16 +347,28 @@
       processModelNumber:
         description: 宸ヨ壓妯″瀷缂栧彿
         type: string
+      realEndTime:
+        type: integer
+      realStartTime:
+        type: integer
       startTime:
         type: integer
       status:
         $ref: '#/definitions/model.ProcedureStatus'
+      updatedAt:
+        type: string
     type: object
   model.ProcessModel:
     properties:
+      createdAt:
+        type: string
+      deletedAt:
+        type: string
       deviceId:
         description: 鐢ㄤ簬杩囨护鑾峰彇nsq娑堟伅
         type: string
+      id:
+        type: integer
       isUpdate:
         description: 鍓嶇鐢�
         type: boolean
@@ -322,14 +391,32 @@
       product:
         description: 浜у搧鍚嶇О
         type: string
+      updatedAt:
+        type: string
     type: object
   request.AddPlcBrand:
     properties:
+      createdAt:
+        type: string
+      deletedAt:
+        type: string
       id:
         type: integer
       name:
         type: string
+      updatedAt:
+        type: string
     type: object
+  request.QueryType:
+    enum:
+    - 1
+    - 2
+    - 3
+    type: integer
+    x-enum-varnames:
+    - QueryTypeUnFinish
+    - QueryTypeToday
+    - QueryTypeFinished
   request.SendProcessParams:
     properties:
       procedureId:
@@ -337,40 +424,83 @@
     required:
     - procedureId
     type: object
+  request.SetCurrentDevice:
+    properties:
+      currentDeviceID:
+        description: 褰撳墠閫夊畾鐨勭敓浜ц澶�
+        type: string
+    type: object
   request.UpdatePlc:
     properties:
       address:
-        description: |-
-          PortName   string `gorm:"type:varchar(191);comment:绔彛鍚嶇О" json:"portName"`
-          Frequency  int    `gorm:"comment:鏁版嵁鏇存柊棰戠巼 0-瀹炴椂鏇存柊 1-1娆�/绉�" json:"frequency"`
+        description: plc ip鍦板潃锛� method = modbusTCP鐢�
         type: string
       baudRate:
         description: 涓插彛娉㈢壒鐜囷紝 method = serial鏃� 鐢�
         type: integer
       brand:
         type: string
+      createdAt:
+        type: string
+      dataBit:
+        description: 鏁版嵁浣嶏紝method = modbusRTU 鐢�
+        type: integer
+      deletedAt:
+        type: string
       details:
         items:
           $ref: '#/definitions/model.DevicePlcAddress'
         type: array
+      deviceID:
+        description: 璁惧缂栧彿
+        type: string
       id:
         type: integer
       isOpen:
         type: boolean
       method:
         $ref: '#/definitions/constvar.PlcMethod'
+      parity:
+        allOf:
+        - $ref: '#/definitions/constvar.Parity'
+        description: 鏍¢獙鏂瑰紡锛宮ethod = modbusRTU 鐢�
       port:
         description: plc 绔彛鍙凤紝  method =  modbusTCP鐢�
         type: integer
       serialName:
         description: 涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�
         type: string
+      stopBit:
+        description: 鍋滄浣嶏紝method = modbusRTU 鐢�
+        type: integer
+      updatedAt:
+        type: string
     type: object
   request.UpdatePlcBrand:
     properties:
+      createdAt:
+        type: string
+      deletedAt:
+        type: string
       id:
         type: integer
       name:
+        type: string
+      updatedAt:
+        type: string
+    type: object
+  response.DeviceListResponse:
+    properties:
+      currentDeviceID:
+        description: 褰撳墠閫夊畾鐨勭敓浜ц澶�
+        type: string
+      deviceIDList:
+        description: 鐢熶骇璁惧id鍒楄〃
+        items:
+          type: string
+        type: array
+      systemDeviceID:
+        description: 宸ユ帶鏈鸿澶嘔D
         type: string
     type: object
   response.ListResponse:
@@ -543,6 +673,42 @@
       summary: 鏇存柊plc閰嶇疆
       tags:
       - Config
+  /v1/device/list:
+    post:
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: 鎴愬姛
+          schema:
+            allOf:
+            - $ref: '#/definitions/contextx.Response'
+            - properties:
+                data:
+                  $ref: '#/definitions/response.DeviceListResponse'
+              type: object
+      summary: 鑾峰彇褰撳墠闈㈡澘缁戝畾鐨勮澶囧垪琛�
+      tags:
+      - Device
+  /v1/device/set:
+    post:
+      parameters:
+      - description: 鏌ヨ鍙傛暟
+        in: body
+        name: object
+        required: true
+        schema:
+          $ref: '#/definitions/request.SetCurrentDevice'
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: 鎴愬姛
+          schema:
+            $ref: '#/definitions/contextx.Response'
+      summary: 璁剧疆褰撳墠璁惧id
+      tags:
+      - 璁惧
   /v1/plc/productProgress:
     post:
       parameters:
@@ -565,23 +731,6 @@
                   $ref: '#/definitions/response.ProductProgress'
               type: object
       summary: 鑾峰彇鐢熶骇杩涘害
-      tags:
-      - 鐢熶骇鏁伴噺
-  /v1/plc/productProgressRealTime:
-    post:
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: 鎴愬姛
-          schema:
-            allOf:
-            - $ref: '#/definitions/contextx.Response'
-            - properties:
-                data:
-                  $ref: '#/definitions/response.ProductProgress'
-              type: object
-      summary: 瀹炴椂鑾峰彇鐢熶骇杩涘害
       tags:
       - 鐢熶骇鏁伴噺
   /v1/plc/setProductNumber:
@@ -747,6 +896,9 @@
   /v1/task/get:
     get:
       parameters:
+      - in: query
+        name: deviceID
+        type: string
       - description: 椤电爜
         in: query
         name: page
@@ -785,6 +937,53 @@
       summary: 鑾峰彇浠诲姟
       tags:
       - Task
+  /v1/task/listByChannel:
+    get:
+      parameters:
+      - description: 閫氶亾鍙枫�備笉浼犲彇鍏ㄩ儴鐨�
+        in: query
+        name: channel
+        type: integer
+      - in: query
+        name: deviceID
+        type: string
+      - description: 榛樿3
+        in: query
+        name: limit
+        type: integer
+      - description: 榛樿0
+        in: query
+        name: offset
+        type: integer
+      - description: 1 鏈畬鎴� 2 浠婂ぉ鏈畬鎴� 3 宸插畬鎴�
+        enum:
+        - 1
+        - 2
+        - 3
+        in: query
+        name: type
+        type: integer
+        x-enum-varnames:
+        - QueryTypeUnFinish
+        - QueryTypeToday
+        - QueryTypeFinished
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: 鎴愬姛
+          schema:
+            allOf:
+            - $ref: '#/definitions/contextx.Response'
+            - properties:
+                data:
+                  additionalProperties:
+                    $ref: '#/definitions/response.TaskResponse'
+                  type: object
+              type: object
+      summary: 鑾峰彇浠诲姟鍒楄〃2
+      tags:
+      - Task
   /v1/task/sendProcessParams:
     post:
       parameters:

--
Gitblit v1.8.0