From 14fc2f577e2c0b7b146c1a430e9438f317ad5b0c Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期六, 23 九月 2023 14:14:27 +0800 Subject: [PATCH] 任务接收增加channel字段,postion字段改为channel --- docs/docs.go | 312 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 288 insertions(+), 24 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 1f4a9ab..b41553d 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -153,14 +153,25 @@ } }, "/v1/plc/productProgress": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ - "鑾峰彇鍔ㄦ�佹暟鎹�" + "鐢熶骇鏁伴噺" ], "summary": "鑾峰彇鐢熶骇杩涘害", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SendProcessParams" + } + } + ], "responses": { "200": { "description": "鎴愬姛", @@ -178,6 +189,56 @@ } } ] + } + } + } + } + }, + "/v1/plc/productProgressRealTime": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "鐢熶骇鏁伴噺" + ], + "summary": "瀹炴椂鑾峰彇鐢熶骇杩涘害", + "responses": { + "200": { + "description": "鎴愬姛", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/contextx.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.ProductProgress" + } + } + } + ] + } + } + } + } + }, + "/v1/plc/setProductNumber": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "鐢熶骇鏁伴噺" + ], + "summary": "璁剧疆鐢熶骇鎬婚噺", + "responses": { + "200": { + "description": "鎴愬姛", + "schema": { + "$ref": "#/definitions/contextx.Response" } } } @@ -305,6 +366,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": [ @@ -342,6 +434,20 @@ "Task" ], "summary": "鑾峰彇浠诲姟", + "parameters": [ + { + "type": "integer", + "description": "椤电爜", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "姣忛〉澶у皬", + "name": "pageSize", + "in": "query" + } + ], "responses": { "200": { "description": "鎴愬姛", @@ -364,7 +470,52 @@ } } }, - "/v1/task/sendProcessParams/{id}": { + "/v1/task/get/unStarted": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Task" + ], + "summary": "鑾峰彇鏈紑濮嬬殑浠诲姟", + "parameters": [ + { + "type": "integer", + "description": "椤电爜", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "姣忛〉澶у皬", + "name": "pageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "鎴愬姛", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/contextx.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.TaskData" + } + } + } + ] + } + } + } + } + }, + "/v1/task/sendProcessParams": { "post": { "produces": [ "application/json" @@ -372,14 +523,16 @@ "tags": [ "Task" ], - "summary": "涓嬪彂宸ヨ壓鍙傛暟", + "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": { @@ -400,7 +553,7 @@ "tags": [ "Task" ], - "summary": "浠诲姟寮�濮�", + "summary": "浠诲姟寮�濮嬶紙鑾峰彇宸ヨ壓鍙傛暟锛�", "parameters": [ { "type": "integer", @@ -474,6 +627,17 @@ "common.ProductProcedure": { "type": "object", "properties": { + "allProcedureNames": { + "description": "鎵�灞炲伐鍗曞伐搴忓垪琛�", + "type": "array", + "items": { + "type": "string" + } + }, + "channel": { + "description": "閫氶亾搴忓彿", + "type": "integer" + }, "deviceId": { "type": "string" }, @@ -528,11 +692,37 @@ "type": "string", "enum": [ "modbusTCP", - "serial" + "serial", + "缃戠粶", + "涓插彛" ], "x-enum-varnames": [ "PlcMethodModbusTCP", - "PlcMethodSerial" + "PlcMethodSerial", + "PlcMethodModbusTCPChinese", + "PlcMethodSerialChinese" + ] + }, + "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": { @@ -551,7 +741,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": "PortName string ` + "`" + `gorm:\"type:varchar(191);comment:绔彛鍚嶇О\" json:\"portName\"` + "`" + `\nFrequency int ` + "`" + `gorm:\"comment:鏁版嵁鏇存柊棰戠巼 0-瀹炴椂鏇存柊 1-1娆�/绉抃" json:\"frequency\"` + "`" + `", "type": "string" }, "baudRate": { @@ -589,9 +779,17 @@ "model.DevicePlcAddress": { "type": "object", "properties": { + "channel": { + "description": "鏁版嵁璧峰鍦板潃", + "type": "integer" + }, "fieldName": { "description": "瀵瑰簲绯荤粺瀛楁", - "type": "integer" + "allOf": [ + { + "$ref": "#/definitions/constvar.PlcStartAddressType" + } + ] }, "length": { "description": "鏁版嵁闀垮害", @@ -603,7 +801,11 @@ }, "type": { "description": "鏁版嵁绫诲瀷", - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/constvar.PlcStartAddressValueType" + } + ] } } }, @@ -713,10 +915,12 @@ "type": "integer", "enum": [ 1, - 2 + 2, + 3 ], "x-enum-varnames": [ - "OrderStatusUnFinished", + "OrderStatusWaitProcess", + "OrderStatusProcessing", "OrderStatusFinished" ] }, @@ -735,16 +939,25 @@ "type": "integer", "enum": [ 1, - 2 + 2, + 3 ], "x-enum-varnames": [ - "ProcedureStatusUnFinished", + "ProcedureStatusWaitProcess", + "ProcedureStatusProcessing", "ProcedureStatusFinished" ] }, "model.Procedures": { "type": "object", "properties": { + "channel": { + "description": "閫氶亾", + "type": "integer" + }, + "deviceId": { + "type": "string" + }, "endTime": { "type": "integer" }, @@ -758,6 +971,9 @@ "$ref": "#/definitions/common.ProductProcedure" } ] + }, + "procedureId": { + "type": "string" }, "startTime": { "type": "integer" @@ -778,11 +994,25 @@ } } }, + "request.SendProcessParams": { + "type": "object", + "required": [ + "procedureId" + ], + "properties": { + "channel": { + "type": "integer" + }, + "procedureId": { + "type": "integer" + } + } + }, "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\"` + "`" + `", + "description": "PortName string ` + "`" + `gorm:\"type:varchar(191);comment:绔彛鍚嶇О\" json:\"portName\"` + "`" + `\nFrequency int ` + "`" + `gorm:\"comment:鏁版嵁鏇存柊棰戠巼 0-瀹炴椂鏇存柊 1-1娆�/绉抃" json:\"frequency\"` + "`" + `", "type": "string" }, "baudRate": { @@ -871,17 +1101,51 @@ "properties": { "finishNumber": { "type": "integer" + }, + "plcStatus": { + "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": { - "deviceName": { - "type": "string" + "allProcedures": { + "type": "array", + "items": { + "type": "string" + } }, - "deviceStatus": { - "type": "string" + "canStarted": { + "description": "鏄惁鍙互寮�濮嬬敓浜�", + "type": "boolean" + }, + "channel": { + "description": "褰撳墠浠诲姟鍦ㄨ澶囩鍑犱釜閫氶亾", + "type": "integer" + }, + "currentProcedureIndex": { + "type": "integer" }, "order": { "$ref": "#/definitions/model.Order" -- Gitblit v1.8.0