package vehicle import ( "context" "gd_crontab/apis" "encoding/json" "fmt" "strings" "time" ) func RunProviderExport(){ now := time.Now().Format("2006-01-02 15:04:05") array := strings.Split(now, " ") now = fmt.Sprintf("%s 00:00:00", array[0]) loc, _ := time.LoadLocation("Local") end, _ := time.ParseInLocation("2006-01-02 15:04:05", now, loc) start := end.AddDate(0, 0, -2) end = end.AddDate(0, 0, -1) req := apis.LogQueryProviderCountExportReq{} reply := apis.LogQueryProviderCountExportReply{} req.StartTimestamp = start.Unix() req.EndTimestamp = end.Unix() //err := crontab.LogQueryProviderCountExportNew(&req,&reply) if err := xcli.Call(context.Background(), "ExportProviderDay", req, &reply); err != nil { fmt.Println("failed to call: ", err) } else { d, _ := json.Marshal(reply) fmt.Println(string(d)) } }