HookTasks returns a list of hook tasks by given conditions.
(hookID int64, page int)
| 502 | |
| 503 | // HookTasks returns a list of hook tasks by given conditions. |
| 504 | func HookTasks(hookID int64, page int) ([]*HookTask, error) { |
| 505 | tasks := make([]*HookTask, 0, conf.Webhook.PagingNum) |
| 506 | return tasks, x.Limit(conf.Webhook.PagingNum, (page-1)*conf.Webhook.PagingNum).Where("hook_id=?", hookID).Desc("id").Find(&tasks) |
| 507 | } |
| 508 | |
| 509 | // createHookTask creates a new hook task, |
| 510 | // it handles conversion from Payload to PayloadContent. |