From 372e5032b10eddc00b7a87a862a71dea6705609c Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期三, 01 十一月 2023 10:58:15 +0800
Subject: [PATCH] update doc
---
docs/docs.go | 637 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 625 insertions(+), 12 deletions(-)
diff --git a/docs/docs.go b/docs/docs.go
index d76cf46..aee4b02 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -152,8 +152,69 @@
}
}
},
+ "/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/setCurrentDeviceId": {
+ "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": {
- "get": {
+ "post": {
"produces": [
"application/json"
],
@@ -161,6 +222,17 @@
"鐢熶骇鏁伴噺"
],
"summary": "鑾峰彇鐢熶骇杩涘害",
+ "parameters": [
+ {
+ "description": "鏌ヨ鍙傛暟",
+ "name": "object",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/request.SendProcessParams"
+ }
+ }
+ ],
"responses": {
"200": {
"description": "鎴愬姛",
@@ -324,6 +396,68 @@
}
}
},
+ "/v1/processModel/list": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "宸ヨ壓妯″瀷"
+ ],
+ "summary": "鑾峰彇宸ヨ壓妯″瀷鍒楄〃",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "褰撳墠姝e湪浣跨敤鐨勫伐鑹哄弬鏁扮紪鍙�",
+ "name": "number",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "椤电爜",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "姣忛〉澶у皬",
+ "name": "pageSize",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "褰撳墠鐨勫伐搴廼d",
+ "name": "procedureId",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "鎴愬姛",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/contextx.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/model.ProcessModel"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/v1/task/countdown": {
"get": {
"produces": [
@@ -394,6 +528,11 @@
"summary": "鑾峰彇浠诲姟",
"parameters": [
{
+ "type": "string",
+ "name": "deviceID",
+ "in": "query"
+ },
+ {
"type": "integer",
"description": "椤电爜",
"name": "page",
@@ -403,6 +542,26 @@
"type": "integer",
"description": "姣忛〉澶у皬",
"name": "pageSize",
+ "in": "query"
+ },
+ {
+ "enum": [
+ 1,
+ 2,
+ 3
+ ],
+ "type": "integer",
+ "x-enum-comments": {
+ "TaskModeCurrent": "鏈紑濮嬬殑鍜岃繘琛屼腑鐨�",
+ "TaskModeLastFinished": "涓婁竴涓粨鏉熺殑",
+ "TaskModeUnStarted": "鏈紑濮嬬殑"
+ },
+ "x-enum-varnames": [
+ "TaskModeUnStarted",
+ "TaskModeCurrent",
+ "TaskModeLastFinished"
+ ],
+ "name": "taskMode",
"in": "query"
}
],
@@ -418,7 +577,7 @@
"type": "object",
"properties": {
"data": {
- "$ref": "#/definitions/response.TaskData"
+ "$ref": "#/definitions/response.TaskResponse"
}
}
}
@@ -428,7 +587,82 @@
}
}
},
- "/v1/task/sendProcessParams/{id}": {
+ "/v1/task/list": {
+ "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"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/v1/task/sendProcessParams": {
"post": {
"produces": [
"application/json"
@@ -439,11 +673,13 @@
"summary": "涓嬪彂宸ヨ壓鍙傛暟锛堝紑濮嬩换鍔★級",
"parameters": [
{
- "type": "integer",
- "description": "宸ュ簭id",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "鏌ヨ鍙傛暟",
+ "name": "object",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/request.SendProcessParams"
+ }
}
],
"responses": {
@@ -495,6 +731,36 @@
}
}
}
+ },
+ "/v1/task/updateProcessParams": {
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Task"
+ ],
+ "summary": "鏇存柊宸ヨ壓鍙傛暟锛堣繘琛屼腑鐨勪换鍔★級",
+ "parameters": [
+ {
+ "description": "鏌ヨ鍙傛暟",
+ "name": "object",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/request.SendProcessParams"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "鎴愬姛",
+ "schema": {
+ "$ref": "#/definitions/contextx.Response"
+ }
+ }
+ }
+ }
}
},
"definitions": {
@@ -538,6 +804,17 @@
"common.ProductProcedure": {
"type": "object",
"properties": {
+ "allProcedureNames": {
+ "description": "鎵�灞炲伐鍗曞伐搴忓垪琛�",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "channel": {
+ "description": "閫氶亾搴忓彿",
+ "type": "integer"
+ },
"deviceId": {
"type": "string"
},
@@ -588,15 +865,50 @@
}
}
},
+ "conf.Prompt": {
+ "type": "object",
+ "properties": {
+ "plcNotConnected": {
+ "type": "string"
+ },
+ "safeProduce": {
+ "type": "string"
+ }
+ }
+ },
+ "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",
- "serial"
+ "modbusRTU",
+ "serial",
+ "缃戠粶",
+ "涓插彛"
],
"x-enum-varnames": [
"PlcMethodModbusTCP",
- "PlcMethodSerial"
+ "PlcMethodModbusRTU",
+ "PlcMethodSerial",
+ "PlcMethodModbusTCPChinese",
+ "PlcMethodSerialChinese"
]
},
"constvar.PlcStartAddressType": {
@@ -621,6 +933,24 @@
"PlcStartAddressValueTypeInt"
]
},
+ "constvar.TaskMode": {
+ "type": "integer",
+ "enum": [
+ 1,
+ 2,
+ 3
+ ],
+ "x-enum-comments": {
+ "TaskModeCurrent": "鏈紑濮嬬殑鍜岃繘琛屼腑鐨�",
+ "TaskModeLastFinished": "涓婁竴涓粨鏉熺殑",
+ "TaskModeUnStarted": "鏈紑濮嬬殑"
+ },
+ "x-enum-varnames": [
+ "TaskModeUnStarted",
+ "TaskModeCurrent",
+ "TaskModeLastFinished"
+ ]
+ },
"contextx.Response": {
"type": "object",
"properties": {
@@ -637,7 +967,7 @@
"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\"` + "`" + `",
+ "description": "plc ip鍦板潃锛� method = modbusTCP鐢�",
"type": "string"
},
"baudRate": {
@@ -647,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"
@@ -662,6 +1006,14 @@
"method": {
"$ref": "#/definitions/constvar.PlcMethod"
},
+ "parity": {
+ "description": "鏍¢獙鏂瑰紡锛宮ethod = modbusRTU 鐢�",
+ "allOf": [
+ {
+ "$ref": "#/definitions/constvar.Parity"
+ }
+ ]
+ },
"port": {
"description": "plc 绔彛鍙凤紝 method = modbusTCP鐢�",
"type": "integer"
@@ -669,12 +1021,23 @@
"serialName": {
"description": "涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�",
"type": "string"
+ },
+ "stopBit": {
+ "description": "鍋滄浣嶏紝method = modbusRTU 鐢�",
+ "type": "integer"
+ },
+ "updatedAt": {
+ "type": "string"
}
}
},
"model.DevicePlcAddress": {
"type": "object",
"properties": {
+ "channel": {
+ "description": "鏁版嵁璧峰鍦板潃",
+ "type": "integer"
+ },
"fieldName": {
"description": "瀵瑰簲绯荤粺瀛楁",
"allOf": [
@@ -710,6 +1073,12 @@
"networkCard"
],
"properties": {
+ "createdAt": {
+ "type": "string"
+ },
+ "deletedAt": {
+ "type": "string"
+ },
"dns": {
"description": "dns",
"type": "string"
@@ -740,6 +1109,9 @@
"$ref": "#/definitions/model.NetConfigStatus"
}
]
+ },
+ "updatedAt": {
+ "type": "string"
}
}
},
@@ -764,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": {
@@ -798,6 +1179,9 @@
"unit": {
"type": "string"
},
+ "updatedAt": {
+ "type": "string"
+ },
"workOrderId": {
"type": "string"
}
@@ -819,10 +1203,19 @@
"model.PlcBrand": {
"type": "object",
"properties": {
+ "createdAt": {
+ "type": "string"
+ },
+ "deletedAt": {
+ "type": "string"
+ },
"id": {
"type": "integer"
},
"name": {
+ "type": "string"
+ },
+ "updatedAt": {
"type": "string"
}
}
@@ -843,6 +1236,16 @@
"model.Procedures": {
"type": "object",
"properties": {
+ "channel": {
+ "description": "閫氶亾",
+ "type": "integer"
+ },
+ "createdAt": {
+ "type": "string"
+ },
+ "deletedAt": {
+ "type": "string"
+ },
"deviceId": {
"type": "string"
},
@@ -863,21 +1266,127 @@
"procedureId": {
"type": "string"
},
+ "processModelNumber": {
+ "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": "鍓嶇鐢�",
+ "type": "boolean"
+ },
+ "newNumber": {
+ "type": "string"
+ },
+ "newParamsMap": {
+ "type": "object",
+ "additionalProperties": true
+ },
+ "number": {
+ "description": "宸ヨ壓妯″瀷缂栧彿",
+ "type": "string"
+ },
+ "params": {
+ "type": "string"
+ },
+ "paramsMap": {
+ "type": "object",
+ "additionalProperties": true
+ },
+ "procedure": {
+ "description": "宸ュ簭",
+ "type": "string"
+ },
+ "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",
+ "required": [
+ "procedureId"
+ ],
+ "properties": {
+ "procedureId": {
+ "type": "integer"
+ }
+ }
+ },
+ "request.SetCurrentDevice": {
+ "type": "object",
+ "properties": {
+ "currentDeviceID": {
+ "description": "褰撳墠閫夊畾鐨勭敓浜ц澶�",
"type": "string"
}
}
@@ -886,7 +1395,7 @@
"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\"` + "`" + `",
+ "description": "plc ip鍦板潃锛� method = modbusTCP鐢�",
"type": "string"
},
"baudRate": {
@@ -896,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"
@@ -911,6 +1434,14 @@
"method": {
"$ref": "#/definitions/constvar.PlcMethod"
},
+ "parity": {
+ "description": "鏍¢獙鏂瑰紡锛宮ethod = modbusRTU 鐢�",
+ "allOf": [
+ {
+ "$ref": "#/definitions/constvar.Parity"
+ }
+ ]
+ },
"port": {
"description": "plc 绔彛鍙凤紝 method = modbusTCP鐢�",
"type": "integer"
@@ -918,16 +1449,52 @@
"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"
}
}
@@ -976,6 +1543,9 @@
"finishNumber": {
"type": "integer"
},
+ "plcStatus": {
+ "type": "integer"
+ },
"totalNumber": {
"type": "integer"
}
@@ -1007,6 +1577,14 @@
"type": "string"
}
},
+ "canStarted": {
+ "description": "鏄惁鍙互寮�濮嬬敓浜�",
+ "type": "boolean"
+ },
+ "channel": {
+ "description": "褰撳墠浠诲姟鍦ㄨ澶囩鍑犱釜閫氶亾",
+ "type": "integer"
+ },
"currentProcedureIndex": {
"type": "integer"
},
@@ -1017,6 +1595,41 @@
"$ref": "#/definitions/model.Procedures"
}
}
+ },
+ "response.TaskResponse": {
+ "type": "object",
+ "properties": {
+ "channelAmount": {
+ "description": "閫氶亾鏁伴噺",
+ "type": "integer"
+ },
+ "prompt": {
+ "description": "鎻愮ず璇�",
+ "allOf": [
+ {
+ "$ref": "#/definitions/conf.Prompt"
+ }
+ ]
+ },
+ "taskCount": {
+ "description": "浠诲姟鏁伴噺",
+ "type": "integer"
+ },
+ "tasks": {
+ "description": "浠诲姟鍒楄〃",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/response.TaskData"
+ }
+ },
+ "workers": {
+ "description": "浜哄憳鍒楄〃",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/common.ProcedureWorker"
+ }
+ }
+ }
}
}
}`
--
Gitblit v1.8.0