From 74f8cd07a39795656573d4e4bb2fe85a6dadbb8c Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期六, 02 九月 2023 15:15:44 +0800 Subject: [PATCH] 从云端请求工艺参数,加入deviceId字段用于消息过滤 --- docs/swagger.yaml | 142 ++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 127 insertions(+), 15 deletions(-) diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 6a2ec4e..34d675d 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -36,6 +36,10 @@ items: $ref: '#/definitions/common.ProcedureMaterial' type: array + nextProcedureId: + type: string + nextProcedureName: + type: string outputMaterials: description: 杈撳嚭鐗╂枡鍒楄〃 items: @@ -55,6 +59,30 @@ $ref: '#/definitions/common.ProcedureWorker' type: array type: object + constvar.PlcMethod: + enum: + - modbusTCP + - serial + type: string + x-enum-varnames: + - PlcMethodModbusTCP + - PlcMethodSerial + constvar.PlcStartAddressType: + enum: + - 1 + - 2 + type: integer + x-enum-varnames: + - PlcStartAddressTypeFinishNumber + - PlcStartAddressTypeTotalNumber + constvar.PlcStartAddressValueType: + enum: + - string + - int + type: string + x-enum-varnames: + - PlcStartAddressValueTypeString + - PlcStartAddressValueTypeInt contextx.Response: properties: code: @@ -66,31 +94,38 @@ model.DevicePlc: properties: address: + description: |- + PortName string `gorm:"type:varchar(191);comment:绔彛鍚嶇О" json:"portName"` + Frequency int `gorm:"type:int(11);comment:鏁版嵁鏇存柊棰戠巼 0-瀹炴椂鏇存柊 1-1娆�/绉�" json:"frequency"` type: string + baudRate: + description: 涓插彛娉㈢壒鐜囷紝 method = serial鏃� 鐢� + type: integer brand: type: string details: items: $ref: '#/definitions/model.DevicePlcAddress' type: array - frequency: - type: integer id: type: integer isOpen: type: boolean method: - type: string + $ref: '#/definitions/constvar.PlcMethod' port: + description: plc 绔彛鍙凤紝 method = modbusTCP鐢� type: integer - portName: + serialName: + description: 涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢� type: string type: object model.DevicePlcAddress: properties: fieldName: + allOf: + - $ref: '#/definitions/constvar.PlcStartAddressType' description: 瀵瑰簲绯荤粺瀛楁 - type: string length: description: 鏁版嵁闀垮害 type: integer @@ -98,8 +133,9 @@ description: 鏁版嵁璧峰鍦板潃 type: integer type: + allOf: + - $ref: '#/definitions/constvar.PlcStartAddressValueType' description: 鏁版嵁绫诲瀷 - type: string type: object model.NetConfig: properties: @@ -219,24 +255,30 @@ request.UpdatePlc: properties: address: + description: |- + PortName string `gorm:"type:varchar(191);comment:绔彛鍚嶇О" json:"portName"` + Frequency int `gorm:"type:int(11);comment:鏁版嵁鏇存柊棰戠巼 0-瀹炴椂鏇存柊 1-1娆�/绉�" json:"frequency"` type: string + baudRate: + description: 涓插彛娉㈢壒鐜囷紝 method = serial鏃� 鐢� + type: integer brand: type: string details: items: $ref: '#/definitions/model.DevicePlcAddress' type: array - frequency: - type: integer id: type: integer isOpen: type: boolean method: - type: string + $ref: '#/definitions/constvar.PlcMethod' port: + description: plc 绔彛鍙凤紝 method = modbusTCP鐢� type: integer - portName: + serialName: + description: 涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢� type: string type: object request.UpdatePlcBrand: @@ -262,14 +304,40 @@ type: string value: {} type: object + response.ProcessParamsResponse: + properties: + number: + type: string + params: + items: + $ref: '#/definitions/response.ProcessParams' + type: array + type: object + response.ProductProgress: + properties: + finishNumber: + type: integer + totalNumber: + type: integer + type: object + response.TaskCountdown: + properties: + countDownHour: + description: 鍊掕鏃� 鏃� + type: integer + countDownMinute: + description: 鍊掕鏃� 鍒� + type: integer + showCountDown: + description: 鏄惁灞曠ず鍊掕鏃� + type: boolean + type: object response.TaskData: properties: deviceName: type: string deviceStatus: type: string - nextProcedure: - $ref: '#/definitions/model.Procedures' order: $ref: '#/definitions/model.Order' procedure: @@ -357,6 +425,35 @@ summary: 鏇存柊plc閰嶇疆 tags: - Config + /v1/plc/productProgress: + get: + 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: + post: + produces: + - application/json + responses: + "200": + description: 鎴愬姛 + schema: + $ref: '#/definitions/contextx.Response' + summary: 璁剧疆鐢熶骇鎬婚噺 + tags: + - 鐢熶骇鏁伴噺 /v1/plcBrand/add: post: parameters: @@ -432,6 +529,23 @@ summary: 鏇存柊plc鍝佺墝 tags: - plc鍝佺墝 + /v1/task/countdown: + get: + produces: + - application/json + responses: + "200": + description: 鎴愬姛 + schema: + allOf: + - $ref: '#/definitions/contextx.Response' + - properties: + data: + $ref: '#/definitions/response.TaskCountdown' + type: object + summary: 鏂颁换鍔″�掕鏃� + tags: + - Task /v1/task/finish/{id}: put: parameters: @@ -503,9 +617,7 @@ - $ref: '#/definitions/contextx.Response' - properties: data: - items: - $ref: '#/definitions/response.ProcessParams' - type: array + $ref: '#/definitions/response.ProcessParamsResponse' type: object summary: 浠诲姟寮�濮� tags: -- Gitblit v1.8.0