| | |
| | | // @Summary 获取任务 |
| | | // @Produce application/json |
| | | // @Param object query request.TaskList true "查询参数" |
| | | // @Success 200 {object} contextx.Response{data=response.TaskData} "成功" |
| | | // @Success 200 {object} contextx.Response{data=response.TaskResponse} "成功" |
| | | // @Router /v1/task/get [get] |
| | | func (slf *TaskApi) TaskGet(c *gin.Context) { |
| | | var params request.TaskList |
| | |
| | | } |
| | | |
| | | taskResponse.Prompt = conf.Conf.Prompt |
| | | taskResponse.ChannelAmount = channelAmount |
| | | |
| | | ctx.OkWithDetailed(taskResponse) |
| | | } |
| | |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/response.TaskData" |
| | | "$ref": "#/definitions/response.TaskResponse" |
| | | } |
| | | } |
| | | } |
| | |
| | | "items": { |
| | | "$ref": "#/definitions/common.ProcedureWorker" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "conf.Prompt": { |
| | | "type": "object", |
| | | "properties": { |
| | | "safeProduce": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "$ref": "#/definitions/model.Procedures" |
| | | } |
| | | } |
| | | }, |
| | | "response.TaskResponse": { |
| | | "type": "object", |
| | | "properties": { |
| | | "channelAmount": { |
| | | "description": "通道数量", |
| | | "type": "integer" |
| | | }, |
| | | "prompt": { |
| | | "description": "提示语", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/conf.Prompt" |
| | | } |
| | | ] |
| | | }, |
| | | "taskCount": { |
| | | "description": "任务数量", |
| | | "type": "integer" |
| | | }, |
| | | "tasks": { |
| | | "description": "任务列表", |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/response.TaskData" |
| | | } |
| | | }, |
| | | "workers": { |
| | | "description": "人员列表", |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/common.ProcedureWorker" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }` |
| | |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/response.TaskData" |
| | | "$ref": "#/definitions/response.TaskResponse" |
| | | } |
| | | } |
| | | } |
| | |
| | | "items": { |
| | | "$ref": "#/definitions/common.ProcedureWorker" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "conf.Prompt": { |
| | | "type": "object", |
| | | "properties": { |
| | | "safeProduce": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "$ref": "#/definitions/model.Procedures" |
| | | } |
| | | } |
| | | }, |
| | | "response.TaskResponse": { |
| | | "type": "object", |
| | | "properties": { |
| | | "channelAmount": { |
| | | "description": "通道数量", |
| | | "type": "integer" |
| | | }, |
| | | "prompt": { |
| | | "description": "提示语", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/conf.Prompt" |
| | | } |
| | | ] |
| | | }, |
| | | "taskCount": { |
| | | "description": "任务数量", |
| | | "type": "integer" |
| | | }, |
| | | "tasks": { |
| | | "description": "任务列表", |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/response.TaskData" |
| | | } |
| | | }, |
| | | "workers": { |
| | | "description": "人员列表", |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/common.ProcedureWorker" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | $ref: '#/definitions/common.ProcedureWorker' |
| | | type: array |
| | | type: object |
| | | conf.Prompt: |
| | | properties: |
| | | safeProduce: |
| | | type: string |
| | | type: object |
| | | constvar.PlcMethod: |
| | | enum: |
| | | - modbusTCP |
| | |
| | | procedure: |
| | | $ref: '#/definitions/model.Procedures' |
| | | type: object |
| | | response.TaskResponse: |
| | | properties: |
| | | channelAmount: |
| | | description: 通道数量 |
| | | type: integer |
| | | prompt: |
| | | allOf: |
| | | - $ref: '#/definitions/conf.Prompt' |
| | | description: 提示语 |
| | | taskCount: |
| | | description: 任务数量 |
| | | type: integer |
| | | tasks: |
| | | description: 任务列表 |
| | | items: |
| | | $ref: '#/definitions/response.TaskData' |
| | | type: array |
| | | workers: |
| | | description: 人员列表 |
| | | items: |
| | | $ref: '#/definitions/common.ProcedureWorker' |
| | | type: array |
| | | type: object |
| | | info: |
| | | contact: {} |
| | | paths: |
| | |
| | | - $ref: '#/definitions/contextx.Response' |
| | | - properties: |
| | | data: |
| | | $ref: '#/definitions/response.TaskData' |
| | | $ref: '#/definitions/response.TaskResponse' |
| | | type: object |
| | | summary: 获取任务 |
| | | tags: |
| | |
| | | } |
| | | |
| | | type TaskResponse struct { |
| | | Tasks []*TaskData |
| | | TaskCount int64 |
| | | Tasks []*TaskData //任务列表 |
| | | TaskCount int64 //任务数量 |
| | | Workers []*common.ProcedureWorker `json:"workers"` // 人员列表 |
| | | Prompt conf.Prompt |
| | | Prompt conf.Prompt //提示语 |
| | | ChannelAmount int //通道数量 |
| | | } |
| | | |
| | | type Config struct { |