package message import ( <<<<<<< Updated upstream logger "eta_mini_ht_api/common/component/log" "eta_mini_ht_api/common/contants" "eta_mini_ht_api/domian/financial_analyst" "eta_mini_ht_api/models/eta" "eta_mini_ht_api/task/base" ======= <<<<<<< Updated upstream logger "eta/eta_mini_ht_api/common/component/log" "eta/eta_mini_ht_api/common/contants" "eta/eta_mini_ht_api/domian/financial_analyst" "eta/eta_mini_ht_api/models/eta" "eta/eta_mini_ht_api/task/base" >>>>>>> Stashed changes "fmt" "github.com/google/uuid" ======= logger "eta_mini_ht_api/common/component/log" "eta_mini_ht_api/common/contants" "eta_mini_ht_api/domian/financial_analyst" userService "eta_mini_ht_api/domian/user" "eta_mini_ht_api/models/eta" "eta_mini_ht_api/task/base" >>>>>>> Stashed changes "sync" ) var ( taskName base.TaskType = "NoticeTask" cron = "0/5 * * * * *" ) // Execute Task ETA取研报的数据 func (au *AuthorTask) Execute(taskDetail *base.TaskDetail) error { logger.Info(contants.TaskFormat, "监听更新通知开始") metaInfoList := userService.getInitMetaInfos() //报告和媒体 var wg sync.WaitGroup wg.Add(2) <<<<<<< Updated upstream UUID := uuid.New() uuidStr := UUID.String() timeBefore := time.Now().Add(-duration) fmt.Printf("监听更新通知开始:%v", timeBefore) //监听报告 go func(uuid string) { defer wg.Done() //list := reportService.GetNewReportByPublishTime(timeBefore) // users := userService.GetNoticeUsersByReports(list) }(uuidStr) //监听媒体 go func(uuid string) { defer wg.Done() }(uuidStr) wg.Wait() <<<<<<< Updated upstream ======= ======= >>>>>>> Stashed changes >>>>>>> Stashed changes return nil } type AuthorTask struct { } func convert(author eta.ReportAuthor) financial_analyst.FinancialAnalystDTO { return financial_analyst.FinancialAnalystDTO{ Deleted: author.IsDelete, ETAId: author.Id, Name: author.ReportAuthor, Status: author.Enable, } } func init() { authorTask := base.NewTask(taskName, cron, new(AuthorTask), base.PROD) base.RegisterTask(&authorTask) }