From 94a8c84e8d29300644a689ce2cd6f537f1993224 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期六, 19 八月 2023 17:41:30 +0800 Subject: [PATCH] plc查询和修改接口 --- docs/docs.go | 131 ++++++++++++++++++++++++++++++++++--------- 1 files changed, 102 insertions(+), 29 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 4b11609..f066af8 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -16,7 +16,7 @@ "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { - "/v1/cc/nn": { + "/v1/config/net": { "get": { "produces": [ "application/json" @@ -49,7 +49,7 @@ } } }, - "put": { + "post": { "produces": [ "application/json" ], @@ -93,7 +93,7 @@ } } }, - "/v1/config/net": { + "/v1/config/plc": { "get": { "produces": [ "application/json" @@ -101,7 +101,7 @@ "tags": [ "Config" ], - "summary": "鑾峰彇缃戠粶閰嶇疆", + "summary": "鑾峰彇plc閰嶇疆", "responses": { "200": { "description": "鎴愬姛", @@ -114,10 +114,7 @@ "type": "object", "properties": { "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.NetConfig" - } + "$ref": "#/definitions/model.DevicePlc" } } } @@ -126,45 +123,30 @@ } } }, - "put": { + "post": { "produces": [ "application/json" ], "tags": [ "Config" ], - "summary": "璁剧疆缃戠粶閰嶇疆", + "summary": "鏇存柊plc閰嶇疆", "parameters": [ { - "description": "鍙傛暟", + "description": "鏌ヨ鍙傛暟", "name": "object", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/model.NetConfig" + "$ref": "#/definitions/request.UpdatePlc" } } ], "responses": { "200": { - "description": "鎴愬姛", + "description": "OK", "schema": { - "allOf": [ - { - "$ref": "#/definitions/contextx.Response" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/response.ProcessParams" - } - } - } - } - ] + "$ref": "#/definitions/contextx.Response" } } } @@ -520,6 +502,62 @@ } } }, + "model.DevicePlc": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "brand": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/model.DevicePlcAddress" + } + }, + "frequency": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "isOpen": { + "type": "boolean" + }, + "method": { + "type": "string" + }, + "port": { + "type": "integer" + }, + "portName": { + "type": "string" + } + } + }, + "model.DevicePlcAddress": { + "type": "object", + "properties": { + "fieldName": { + "description": "瀵瑰簲绯荤粺瀛楁", + "type": "string" + }, + "length": { + "description": "鏁版嵁闀垮害", + "type": "integer" + }, + "startAddress": { + "description": "鏁版嵁璧峰鍦板潃", + "type": "integer" + }, + "type": { + "description": "鏁版嵁绫诲瀷", + "type": "string" + } + } + }, "model.NetConfig": { "type": "object", "required": [ @@ -691,6 +729,41 @@ } } }, + "request.UpdatePlc": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "brand": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/model.DevicePlcAddress" + } + }, + "frequency": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "isOpen": { + "type": "boolean" + }, + "method": { + "type": "string" + }, + "port": { + "type": "integer" + }, + "portName": { + "type": "string" + } + } + }, "request.UpdatePlcBrand": { "type": "object", "properties": { -- Gitblit v1.8.0