1234567891011121314151617181920212223242526272829 |
- using Quartz;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using XYY.Tool.QuotaReduction;
- namespace XYY.Tool.TimingTask.jobs
- {
- internal class RetryChargeJob : IJob
- {
- public async Task Execute(IJobExecutionContext context)
- {
- RestSharp.RestClient client = new RestSharp.RestClient(JobConfig.ReChargeJobApi);
- RestSharp.RestRequest request = new RestSharp.RestRequest(RestSharp.Method.GET);
- request.AddHeader("Authorization", "token 57AEDE5487260443D6BF2182D31286B1");
-
- string from=DateTime.Now.ToString("yyyy-MM-dd");
- string to=DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");
- string keywork = "Timeout";
- var param = new { from, to, keywork };
- request.AddJsonBody(param);
- var result = await client.ExecuteAsync(request);
- Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 【计费超时重算】执行成功!日期:{from} 到 {to}");
- }
- }
- }
|