UpdateTaskHandler @Tags TASK @Summary 修改任务 @Produce json @Accept json @Header 200 {string} Authorization "必备" @Param data body service.DeleteTaskService true "2" @Success 200 {object} serializer.Response "{"success":true,"data":{},"msg":"ok"}" @Failure 500 {json} {"status":500,"data":{},"Msg":{},"Er
()
| 140 | // @Failure 500 {json} {"status":500,"data":{},"Msg":{},"Error":"error"} |
| 141 | // @Router /task [put] |
| 142 | func UpdateTaskHandler() gin.HandlerFunc { |
| 143 | return func(ctx *gin.Context) { |
| 144 | req := new(types.UpdateTaskReq) |
| 145 | if err := ctx.ShouldBind(&req); err == nil { |
| 146 | // 参数校验 |
| 147 | l := service.GetTaskSrv() |
| 148 | resp, err := l.UpdateTask(ctx.Request.Context(), req) |
| 149 | if err != nil { |
| 150 | ctx.JSON(http.StatusInternalServerError, ErrorResponse(err)) |
| 151 | return |
| 152 | } |
| 153 | ctx.JSON(http.StatusOK, resp) |
| 154 | } else { |
| 155 | util.LogrusObj.Infoln(err) |
| 156 | ctx.JSON(http.StatusBadRequest, ErrorResponse(err)) |
| 157 | } |
| 158 | |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | // SearchTaskHandler @Tags TASK |
| 163 | // @Summary 查询任务 |
no test coverage detected