From fcc5eaccffbbd0980077cf3fc4707566546f879a Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 17 八月 2023 17:31:18 +0800 Subject: [PATCH] 增加plc pkg, 增加获取任务,完成任务,开始任务接口 --- docs/swagger.yaml | 146 ++++++++++++++++++++++++++++++++---------------- 1 files changed, 98 insertions(+), 48 deletions(-) diff --git a/docs/swagger.yaml b/docs/swagger.yaml index d7c6fa3..fa6eed7 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -7,66 +7,109 @@ msg: type: string type: object - model.ScheduleTask: + model.Order: properties: amount: - description: |- - Parameter string `json:"parameter"` //浜у搧鍚嶇О - Customer string `json:"customer"` - DeliverDate string `json:"deliverDate"` - OrderAttr string `json:"orderAttr"` type: number - data: - description: 鎺掔▼浠诲姟json涓� + customer: + type: string + deliverDate: type: string endTime: type: integer - id: - type: integer + orderAttr: + description: 璁㈠崟灞炴�ф嫾鎺ョ殑瀛楃涓诧紝鍗宠揣鐗╂弿杩� + type: string orderId: - description: 璁㈠崟id + type: string + parameter: type: string productId: - description: 璁㈠崟id type: string productName: - description: 浜у搧鍚嶇О type: string startTime: type: integer unit: type: string type: object - request.TaskInfo: + model.Procedures: properties: - device: - description: 璁惧 - type: string - orderId: - description: 璁㈠崟鍙� - type: string - password: - description: 浜у搧 - type: string + id: + type: integer procedure: - description: 宸ュ簭 + allOf: + - $ref: '#/definitions/request.ProductProcedure' + description: request.ProductProcedure 瀵硅薄 + type: object + request.ProcedureMaterial: + properties: + amount: + type: number + materialId: type: string - workOrder: - description: 宸ュ崟 + materialName: type: string + unit: + type: string + type: object + request.ProcedureWorker: + properties: + phoneNum: + type: string + workerId: + type: string + workerName: + type: string + type: object + request.ProductProcedure: + properties: + deviceId: + type: string + endTime: + type: integer + inputMaterials: + description: 杈撳叆鐗╂枡鍒楄〃 + items: + $ref: '#/definitions/request.ProcedureMaterial' + type: array + outputMaterials: + description: 杈撳嚭鐗╂枡鍒楄〃 + items: + $ref: '#/definitions/request.ProcedureMaterial' + type: array + procedureId: + type: string + procedureName: + type: string + startTime: + type: integer + workHours: + type: number + workers: + description: 浜哄憳鍒楄〃 + items: + $ref: '#/definitions/request.ProcedureWorker' + type: array + type: object + response.TaskData: + properties: + order: + $ref: '#/definitions/model.Order' + procedure: + $ref: '#/definitions/model.Procedures' type: object info: contact: {} paths: - /v1/notice/task/start: - post: + /v1/task/finish/{id}: + put: parameters: - - description: 鏌ヨ鍙傛暟 - in: body - name: object + - description: 宸ュ簭id + in: path + name: id required: true - schema: - $ref: '#/definitions/request.TaskInfo' + type: integer produces: - application/json responses: @@ -74,20 +117,11 @@ description: 鎴愬姛 schema: $ref: '#/definitions/contextx.Response' - summary: 浠诲姟寮�鍚�氱煡 + summary: 浠诲姟缁撴潫 tags: - Base - /v1/task/list: + /v1/task/get: get: - parameters: - - description: 椤电爜 - in: query - name: page - type: integer - - description: 姣忛〉澶у皬 - in: query - name: pageSize - type: integer produces: - application/json responses: @@ -98,11 +132,27 @@ - $ref: '#/definitions/contextx.Response' - properties: data: - items: - $ref: '#/definitions/model.ScheduleTask' - type: array + $ref: '#/definitions/response.TaskData' type: object - summary: 浠诲姟寮�鍚�氱煡 + summary: 鑾峰彇浠诲姟 + tags: + - Task + /v1/task/start/{id}: + get: + parameters: + - description: 宸ュ簭id + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 鎴愬姛 + schema: + $ref: '#/definitions/contextx.Response' + summary: 浠诲姟寮�濮� tags: - Base swagger: "2.0" -- Gitblit v1.8.0