抽取数据添加补偿机制
This commit is contained in:
@@ -7,17 +7,17 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func SyncCampaignReportWithMock(ctx context.Context) error {
|
||||
func SyncAccountReportWithMock(ctx context.Context) error {
|
||||
syncService := NewSyncService()
|
||||
|
||||
req := &CampaignReportRequest{
|
||||
req := &AccountReportRequest{
|
||||
AdvertiserID: 10001,
|
||||
StartTime: time.Now().AddDate(0, 0, -30).UnixNano() / 1e6,
|
||||
EndTime: time.Now().UnixNano() / 1e6,
|
||||
SelectColumns: []string{"impression", "click", "cost", "t0GMV"},
|
||||
GroupType: 1,
|
||||
QueryVersion: 1,
|
||||
SelectParam: &CampaignSelectParam{
|
||||
SelectParam: &AccountSelectParam{
|
||||
CampaignIDs: []int64{1, 2, 3},
|
||||
},
|
||||
PageInfo: &PageInfo{
|
||||
@@ -26,7 +26,7 @@ func SyncCampaignReportWithMock(ctx context.Context) error {
|
||||
},
|
||||
}
|
||||
|
||||
result, err := syncService.SyncCampaignReport(ctx, req, true)
|
||||
result, err := syncService.SyncAccountReport(ctx, req, true)
|
||||
if err != nil {
|
||||
logrus.Errorf("同步失败:%v", err)
|
||||
return err
|
||||
@@ -36,10 +36,10 @@ func SyncCampaignReportWithMock(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func SyncCampaignReportWithRealAPI(ctx context.Context, req *CampaignReportRequest) error {
|
||||
func SyncAccountReportWithRealAPI(ctx context.Context, req *AccountReportRequest) error {
|
||||
syncService := NewSyncService()
|
||||
|
||||
result, err := syncService.SyncCampaignReport(ctx, req, false)
|
||||
result, err := syncService.SyncAccountReport(ctx, req, false)
|
||||
if err != nil {
|
||||
logrus.Errorf("同步失败:%v", err)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user