package services import ( "fmt" "github.com/astaxie/beego/toolbox" ) func Task() { fmt.Println("task start") //发送邮件 sendEmail := toolbox.NewTask("sendEmail", "0 0 12 * * 0 ", SendEmail) toolbox.AddTask("sendEmail", sendEmail) oneMinute := toolbox.NewTask("oneMinute", "0 */1 * * * * ", OneMinute) toolbox.AddTask("oneMinute", oneMinute) toolbox.StartTask() fmt.Println("task end") } func SendEmail() (err error) { //报告历史访问次数 go ReportViewTimes() //报告访问详情 go ReportViewDetail() //潜在客户回访记录 go FreeViewerDetail() //用户权限统计 go HongzeUsers() return } func OneMinute() (err error) { //日度 //FrequencyByDay() //周度 FrequencyByWeek() //月度 //FrequencyByMonth() return }