예제 #1
0
        public Task Execute(IJobExecutionContext context)
        {
            string   dateTimeRequestStr;
            DateTime dateTimeUTC = DateTime.UtcNow;

            dateTimeRequestStr = dateTimeUTC.AddMinutes(280).ToString("yyyy-MM-dd hh:mm:ss");

            Dictionary <string, string> requestMessageDict = new Dictionary <string, string>
            {
                ["token"] = "N2U1OThkZDZkZDliZGFiM/lAfhoRNk0D+iJh2Z1h1fpYEUWXkzsbvGg1",
                ["date"]  = dateTimeRequestStr
            };

            using (var scope = _serviceScopeFactory.CreateScope())
            {
                var requestSender = scope.ServiceProvider.GetService <IRequestSender>();
                return(_requestSender.RequestQRcodesReceiving(url, requestMessageDict));
            }

            // отправили запрос, получили ответ, записали в БД данные ответа
            //return Task.CompletedTask;
        }