From 44a78f184ca10fba46df2567496895e179d4ac6c Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期日, 08 十月 2023 11:47:47 +0800 Subject: [PATCH] 增加更新工艺参数接口 --- docs/docs.go | 244 +++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 228 insertions(+), 16 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 2f9b1f7..aea2cf6 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -194,6 +194,37 @@ } } }, + "/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": [ @@ -335,6 +366,65 @@ } } }, + "/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": { + "$ref": "#/definitions/response.TaskCountdown" + } + } + } + ] + } + } + } + } + }, "/v1/task/countdown": { "get": { "produces": [ @@ -415,6 +505,26 @@ "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" } ], "responses": { @@ -429,7 +539,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/response.TaskData" + "$ref": "#/definitions/response.TaskResponse" } } } @@ -508,6 +618,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": { @@ -557,6 +697,10 @@ "items": { "type": "string" } + }, + "channel": { + "description": "閫氶亾搴忓彿", + "type": "integer" }, "deviceId": { "type": "string" @@ -608,6 +752,17 @@ } } }, + "conf.Prompt": { + "type": "object", + "properties": { + "plcNotConnected": { + "type": "string" + }, + "safeProduce": { + "type": "string" + } + } + }, "constvar.PlcMethod": { "type": "string", "enum": [ @@ -645,6 +800,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": { @@ -661,7 +834,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": { @@ -699,6 +872,10 @@ "model.DevicePlcAddress": { "type": "object", "properties": { + "channel": { + "description": "鏁版嵁璧峰鍦板潃", + "type": "integer" + }, "fieldName": { "description": "瀵瑰簲绯荤粺瀛楁", "allOf": [ @@ -709,10 +886,6 @@ }, "length": { "description": "鏁版嵁闀垮害", - "type": "integer" - }, - "position": { - "description": "鏁版嵁璧峰鍦板潃", "type": "integer" }, "startAddress": { @@ -871,6 +1044,10 @@ "model.Procedures": { "type": "object", "properties": { + "channel": { + "description": "閫氶亾", + "type": "integer" + }, "deviceId": { "type": "string" }, @@ -878,10 +1055,6 @@ "type": "integer" }, "id": { - "type": "integer" - }, - "position": { - "description": "姣忎釜璁惧鍙兘鏈夊涓満浣嶅悓鏃剁敓浜э紝鐢╬osition琛ㄧず浣嶇疆", "type": "integer" }, "procedure": { @@ -920,7 +1093,7 @@ "procedureId" ], "properties": { - "position": { + "channel": { "type": "integer" }, "procedureId": { @@ -932,7 +1105,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": { @@ -1056,20 +1229,59 @@ "type": "string" } }, + "canStarted": { + "description": "鏄惁鍙互寮�濮嬬敓浜�", + "type": "boolean" + }, + "channel": { + "description": "褰撳墠浠诲姟鍦ㄨ澶囩鍑犱釜閫氶亾", + "type": "integer" + }, "currentProcedureIndex": { "type": "integer" }, "order": { "$ref": "#/definitions/model.Order" }, - "position": { - "description": "褰撳墠浠诲姟鍦ㄨ澶囩鍑犱釜浣嶇疆", - "type": "integer" - }, "procedure": { "$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