| | |
| | | "host": "{{.Host}}", |
| | | "basePath": "{{.BasePath}}", |
| | | "paths": { |
| | | "/v1/cc/nn": { |
| | | "/v1/config/net": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | |
| | | } |
| | | } |
| | | }, |
| | | "put": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/v1/config/net": { |
| | | "/v1/config/plc": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | |
| | | "tags": [ |
| | | "Config" |
| | | ], |
| | | "summary": "获取网络配置", |
| | | "summary": "获取plc配置", |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/model.NetConfig" |
| | | } |
| | | "$ref": "#/definitions/model.DevicePlc" |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "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" |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "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": [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | "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": { |