修改包名
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"cid/syncdata"
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"cid/sync"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
_ "github.com/gogf/gf/contrib/drivers/pgsql/v2"
|
||||
|
||||
@@ -16,27 +15,27 @@ import (
|
||||
|
||||
func main() {
|
||||
ctx := gctx.New()
|
||||
syncService := sync.NewSyncService()
|
||||
syncService := syncdata.NewSyncService()
|
||||
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
|
||||
|
||||
now := time.Now()
|
||||
lastHourEnd := time.Date(now.Year(), now.Month(), now.Day(), now.Hour(), 0, 0, 0, now.Location())
|
||||
lastHourStart := lastHourEnd.Add(-1 * time.Hour)
|
||||
|
||||
req := &sync.AccountReportRequest{
|
||||
req := &syncdata.AccountReportRequest{
|
||||
AdvertiserID: 10001,
|
||||
StartTime: lastHourStart.UnixMilli(),
|
||||
EndTime: lastHourEnd.UnixMilli(),
|
||||
SelectColumns: []string{"impression", "click", "cost", "t0GMV"},
|
||||
GroupType: 1,
|
||||
QueryVersion: 1,
|
||||
PageInfo: &sync.PageInfo{
|
||||
PageInfo: &syncdata.PageInfo{
|
||||
CurrentPage: 1,
|
||||
PageSize: 10,
|
||||
},
|
||||
}
|
||||
|
||||
config := sync.ConcurrentSyncConfig{
|
||||
config := syncdata.ConcurrentSyncConfig{
|
||||
MaxConcurrency: 5,
|
||||
UseMock: true,
|
||||
MaxRetries: 3,
|
||||
|
||||
@@ -3,7 +3,7 @@ package main
|
||||
import (
|
||||
dao "cid/dao/copydata"
|
||||
taskDto "cid/model/dto/copydata"
|
||||
"cid/sync"
|
||||
"cid/syncdata"
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
@@ -17,13 +17,13 @@ import (
|
||||
|
||||
// CompensationScheduler 补偿调度器,负责扫描和补偿失败的分页同步任务
|
||||
type CompensationScheduler struct {
|
||||
syncService *sync.SyncService
|
||||
syncService *syncdata.SyncService
|
||||
}
|
||||
|
||||
// NewCompensationScheduler 创建补偿调度器实例
|
||||
func NewCompensationScheduler() *CompensationScheduler {
|
||||
return &CompensationScheduler{
|
||||
syncService: sync.NewSyncService(),
|
||||
syncService: syncdata.NewSyncService(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,14 +130,14 @@ func (s *CompensationScheduler) compensatePageTask(ctx context.Context, pageTask
|
||||
|
||||
pageSize := s.extractPageSize(pageTask)
|
||||
|
||||
req := &sync.AccountReportRequest{
|
||||
req := &syncdata.AccountReportRequest{
|
||||
AdvertiserID: pageTask.AdvertiserID,
|
||||
StartTime: startTime.UnixMilli(),
|
||||
EndTime: endTime.UnixMilli(),
|
||||
SelectColumns: []string{"impression", "click", "cost", "t0GMV"},
|
||||
GroupType: 1,
|
||||
QueryVersion: 1,
|
||||
PageInfo: &sync.PageInfo{
|
||||
PageInfo: &syncdata.PageInfo{
|
||||
CurrentPage: pageNumber,
|
||||
PageSize: pageSize,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user