| | |
| | | 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 |
| | |
| | | return taskResponse.Tasks[i].Channel < taskResponse.Tasks[i].Channel |
| | | }) |
| | | |
| | | nowTs := time.Now().Unix() |
| | | for _, task := range taskResponse.Tasks { |
| | | if !service.TaskFlagGet(task.Channel) { |
| | | if !service.TaskFlagGet(task.Channel) && task.Procedure.StartTime <= nowTs { |
| | | task.CanStarted = true |
| | | } |
| | | } |
| | | |
| | | taskResponse.Prompt = conf.Conf.Prompt |
| | | taskResponse.ChannelAmount = channelAmount |
| | | taskResponse.TaskCount = service.NewTaskService().NewTaskCount() |
| | | taskResponse.TaskCount = taskCount |
| | | |
| | | ctx.OkWithDetailed(taskResponse) |
| | | } |