From b555874608be2e4bb40cceba60b497c04caef842 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期二, 12 九月 2023 14:17:51 +0800 Subject: [PATCH] 三菱协议更改 --- docs/docs.go | 210 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 191 insertions(+), 19 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index f066af8..486c228 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -152,6 +152,56 @@ } } }, + "/v1/plc/productProgress": { + "get": { + "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" + } + } + } + } + }, "/v1/plcBrand/add": { "post": { "produces": [ @@ -274,6 +324,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": [ @@ -391,10 +472,7 @@ "type": "object", "properties": { "data": { - "type": "array", - "items": { - "$ref": "#/definitions/response.ProcessParams" - } + "$ref": "#/definitions/response.ProcessParamsResponse" } } } @@ -462,6 +540,12 @@ "$ref": "#/definitions/common.ProcedureMaterial" } }, + "nextProcedureId": { + "type": "string" + }, + "nextProcedureName": { + "type": "string" + }, "outputMaterials": { "description": "杈撳嚭鐗╂枡鍒楄〃", "type": "array", @@ -490,6 +574,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": { @@ -506,7 +623,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" @@ -517,9 +639,6 @@ "$ref": "#/definitions/model.DevicePlcAddress" } }, - "frequency": { - "type": "integer" - }, "id": { "type": "integer" }, @@ -527,12 +646,14 @@ "type": "boolean" }, "method": { - "type": "string" + "$ref": "#/definitions/constvar.PlcMethod" }, "port": { + "description": "plc 绔彛鍙凤紝 method = modbusTCP鐢�", "type": "integer" }, - "portName": { + "serialName": { + "description": "涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�", "type": "string" } } @@ -542,7 +663,11 @@ "properties": { "fieldName": { "description": "瀵瑰簲绯荤粺瀛楁", - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/constvar.PlcStartAddressType" + } + ] }, "length": { "description": "鏁版嵁闀垮害", @@ -554,7 +679,11 @@ }, "type": { "description": "鏁版嵁绫诲瀷", - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/constvar.PlcStartAddressValueType" + } + ] } } }, @@ -733,7 +862,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" @@ -744,9 +878,6 @@ "$ref": "#/definitions/model.DevicePlcAddress" } }, - "frequency": { - "type": "integer" - }, "id": { "type": "integer" }, @@ -754,12 +885,14 @@ "type": "boolean" }, "method": { - "type": "string" + "$ref": "#/definitions/constvar.PlcMethod" }, "port": { + "description": "plc 绔彛鍙凤紝 method = modbusTCP鐢�", "type": "integer" }, - "portName": { + "serialName": { + "description": "涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�", "type": "string" } } @@ -799,6 +932,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": { @@ -807,9 +982,6 @@ }, "deviceStatus": { "type": "string" - }, - "nextProcedure": { - "$ref": "#/definitions/model.Procedures" }, "order": { "$ref": "#/definitions/model.Order" -- Gitblit v1.8.0