| | |
| | | // @Summary 任务开始 |
| | | // @Produce application/json |
| | | // @Param id path int true "工序id" |
| | | // @Success 200 {object} contextx.Response{data=[]response.ProcessParams} "成功" |
| | | // @Success 200 {object} contextx.Response{data=response.ProcessParamsResponse} "成功" |
| | | // @Router /v1/task/start/{id} [get] |
| | | func (slf *TaskApi) TaskStart(c *gin.Context) { |
| | | ctx, ok := contextx.NewContext(c, nil) |
| | |
| | | ctx.FailWithMsg(ecode.UnknownErr, "未获取到工艺参数") |
| | | return |
| | | } |
| | | processParamsArr := make([]*response.ProcessParams, 0, len(resp.ParamsMap)) |
| | | processParamsArr := make([]response.ProcessParams, 0, len(resp.ParamsMap)) |
| | | for k, v := range resp.ParamsMap { |
| | | processParamsArr = append(processParamsArr, &response.ProcessParams{ |
| | | processParamsArr = append(processParamsArr, response.ProcessParams{ |
| | | Key: k, |
| | | Value: v, |
| | | }) |
| | | } |
| | | response := response.ProcessParamsResponse{ |
| | | Number: resp.Number, |
| | | Params: processParamsArr, |
| | | } |
| | | logx.Infof("TaskStart Notice GetProcessModel: %+v", resp) |
| | | ctx.OkWithDetailed(processParamsArr) |
| | | ctx.OkWithDetailed(response) |
| | | } |
| | | |
| | | // TaskFinish |