ShowTaskHandler @Tags TASK @Summary 展示任务详细信息 @Produce json @Accept json @Header 200 {string} Authorization "必备" @Param data body service.ShowTaskService true "rush" @Success 200 {object} serializer.ResponseTask "{"success":true,"data":{},"msg":"ok"}" @Failure 500 {json} {"status":500,"data":{},"Msg"
()
| 82 | // @Failure 500 {json} {"status":500,"data":{},"Msg":{},"Error":"error"} |
| 83 | // @Router /task/:id [get] |
| 84 | func ShowTaskHandler() gin.HandlerFunc { |
| 85 | return func(ctx *gin.Context) { |
| 86 | var req types.ShowTaskReq |
| 87 | if err := ctx.ShouldBind(&req); err == nil { |
| 88 | // 参数校验 |
| 89 | l := service.GetTaskSrv() |
| 90 | resp, err := l.ShowTask(ctx.Request.Context(), &req) |
| 91 | if err != nil { |
| 92 | ctx.JSON(http.StatusInternalServerError, ErrorResponse(err)) |
| 93 | return |
| 94 | } |
| 95 | ctx.JSON(http.StatusOK, resp) |
| 96 | } else { |
| 97 | util.LogrusObj.Infoln(err) |
| 98 | ctx.JSON(http.StatusBadRequest, ErrorResponse(err)) |
| 99 | } |
| 100 | |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | // DeleteTaskHandler @Tags TASK |
| 105 | // @Summary 删除任务 |
no test coverage detected