| | |
| | | // @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 |
| | |
| | | } |
| | | |
| | | params.PageSize = channelAmount |
| | | |
| | | |
| | | taskResponse, code := service.NewTaskService().GetTask(params.Page, params.PageSize, service.TaskModeCurrent) //取进行中的或未开始的 |
| | | if code != ecode.OK { |
| | | ctx.Fail(code) |
| | |
| | | } |
| | | |
| | | taskResponse.Prompt = conf.Conf.Prompt |
| | | taskResponse.ChannelAmount = channelAmount |
| | | |
| | | ctx.OkWithDetailed(taskResponse) |
| | | } |