12345678910111213141516171819202122232425262728293031323334353637 |
- using Quartz;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace XYY.Tool.TimingTask.jobs
- {
- internal class FustGoTrackingJob : IJob
- {
- public Task Execute(IJobExecutionContext context)
- {
- return GetUsps();
- }
- private async Task GetUsps()
- {
- string apiUrl = "http://api.fustgo.com";
- //string apiUrl = "http://localhost:5153";
- string src = "/Tracking/GetUsps";
- RestSharp.RestClient client = new RestSharp.RestClient(apiUrl);
- RestSharp.RestRequest request = new RestSharp.RestRequest(src, RestSharp.Method.GET);
- var resp = await client.ExecuteAsync(request);
- if (resp.IsSuccessful)
- {
- Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")} 处理FUSTGO-USPS轨迹:成功");
- }
- else
- {
- Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")} 处理FUSTGO-USPS轨迹:失败 {resp.Content}");
- }
- }
- }
- }
|