SearchTaskHandler @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
()
| 169 | // @Failure 500 {json} {"status":500,"data":{},"Msg":{},"Error":"error"} |
| 170 | // @Router /search [post] |
| 171 | func SearchTaskHandler() gin.HandlerFunc { |
| 172 | return func(ctx *gin.Context) { |
| 173 | var req types.SearchTaskReq |
| 174 | if err := ctx.ShouldBind(&req); err == nil { |
| 175 | // 参数校验 |
| 176 | l := service.GetTaskSrv() |
| 177 | resp, err := l.SearchTask(ctx.Request.Context(), &req) |
| 178 | if err != nil { |
| 179 | ctx.JSON(http.StatusInternalServerError, ErrorResponse(err)) |
| 180 | return |
| 181 | } |
| 182 | ctx.JSON(http.StatusOK, resp) |
| 183 | } else { |
| 184 | util.LogrusObj.Infoln(err) |
| 185 | ctx.JSON(http.StatusBadRequest, ErrorResponse(err)) |
| 186 | } |
| 187 | |
| 188 | } |
| 189 | } |
no test coverage detected