From c073c915b23db5a3bde659ceed21849b5d0e484c Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期日, 08 十月 2023 10:34:31 +0800 Subject: [PATCH] 获取任务去掉时间限制 --- api/v1/task.go | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/api/v1/task.go b/api/v1/task.go index 419316b..2e2e8ea 100644 --- a/api/v1/task.go +++ b/api/v1/task.go @@ -68,10 +68,14 @@ return } + taskCount := service.NewTaskService().NewTaskCount() params.Page = 1 - if params.PageSize <= 0 { - params.PageSize = channelAmount + if params.TaskMode == constvar.TaskModeUnStarted { + params.PageSize = int(taskCount) + } else { + params.PageSize = channelAmount + } } taskMode := constvar.TaskModeCurrent @@ -115,7 +119,7 @@ taskResponse.Prompt = conf.Conf.Prompt taskResponse.ChannelAmount = channelAmount - taskResponse.TaskCount = service.NewTaskService().NewTaskCount() + taskResponse.TaskCount = taskCount ctx.OkWithDetailed(taskResponse) } -- Gitblit v1.8.0