zhangqian
2023-09-12 b555874608be2e4bb40cceba60b497c04caef842
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,25 +123,44 @@
                    }
                }
            },
            "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": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/v1/plc/productProgress": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "生产数量"
                ],
                "summary": "获取生产进度",
                "responses": {
                    "200": {
                        "description": "成功",
@@ -157,14 +173,30 @@
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/response.ProcessParams"
                                            }
                                            "$ref": "#/definitions/response.ProductProgress"
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/v1/plc/setProductNumber": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "生产数量"
                ],
                "summary": "设置生产总量",
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
@@ -292,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": [
@@ -409,10 +472,7 @@
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/response.ProcessParams"
                                            }
                                            "$ref": "#/definitions/response.ProcessParamsResponse"
                                        }
                                    }
                                }
@@ -480,6 +540,12 @@
                        "$ref": "#/definitions/common.ProcedureMaterial"
                    }
                },
                "nextProcedureId": {
                    "type": "string"
                },
                "nextProcedureName": {
                    "type": "string"
                },
                "outputMaterials": {
                    "description": "输出物料列表",
                    "type": "array",
@@ -508,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": {
@@ -517,6 +616,74 @@
                "data": {},
                "msg": {
                    "type": "string"
                }
            }
        },
        "model.DevicePlc": {
            "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"
                },
                "details": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/model.DevicePlcAddress"
                    }
                },
                "id": {
                    "type": "integer"
                },
                "isOpen": {
                    "type": "boolean"
                },
                "method": {
                    "$ref": "#/definitions/constvar.PlcMethod"
                },
                "port": {
                    "description": "plc 端口号,  method =  modbusTCP用",
                    "type": "integer"
                },
                "serialName": {
                    "description": "串口名称,method = serial时 用",
                    "type": "string"
                }
            }
        },
        "model.DevicePlcAddress": {
            "type": "object",
            "properties": {
                "fieldName": {
                    "description": "对应系统字段",
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.PlcStartAddressType"
                        }
                    ]
                },
                "length": {
                    "description": "数据长度",
                    "type": "integer"
                },
                "startAddress": {
                    "description": "数据起始地址",
                    "type": "integer"
                },
                "type": {
                    "description": "数据类型",
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.PlcStartAddressValueType"
                        }
                    ]
                }
            }
        },
@@ -691,6 +858,45 @@
                }
            }
        },
        "request.UpdatePlc": {
            "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"
                },
                "details": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/model.DevicePlcAddress"
                    }
                },
                "id": {
                    "type": "integer"
                },
                "isOpen": {
                    "type": "boolean"
                },
                "method": {
                    "$ref": "#/definitions/constvar.PlcMethod"
                },
                "port": {
                    "description": "plc 端口号,  method =  modbusTCP用",
                    "type": "integer"
                },
                "serialName": {
                    "description": "串口名称,method = serial时 用",
                    "type": "string"
                }
            }
        },
        "request.UpdatePlcBrand": {
            "type": "object",
            "properties": {
@@ -726,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": {
@@ -734,9 +982,6 @@
                },
                "deviceStatus": {
                    "type": "string"
                },
                "nextProcedure": {
                    "$ref": "#/definitions/model.Procedures"
                },
                "order": {
                    "$ref": "#/definitions/model.Order"