Пример #1
0
        public IActionResult Uber()
        {
            var dates = GetDates();

            ReportsProvider.StartReport(Reports.Uber, _amo, _processQueue, _gSheets, dates.Item1, dates.Item2);

            return(Ok("Requested."));
        }
Пример #2
0
        [HttpGet("{from},{to}")]                                                                                                                //Запрашиваем отчёт для диапазона дат
        public IActionResult CorporateSales(string from, string to)
        {
            if (!long.TryParse(from, out long dateFrom) &
                !long.TryParse(to, out long dateTo))
            {
                return(BadRequest("Incorrect dates"));
            }

            ReportsProvider.StartReport(Reports.CorporateSales, _amo, _processQueue, _gSheets, dateFrom, dateTo);

            return(Ok("Requested."));
        }
Пример #3
0
        public IActionResult Calls()
        {
            var  now      = DateTime.UtcNow.AddHours(3);
            var  to       = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0, DateTimeKind.Utc).AddHours(-3).AddSeconds(-1);
            var  from     = to.AddSeconds(1).AddDays(-1);
            long dateFrom = ((DateTimeOffset)from).ToUnixTimeSeconds();
            long dateTo   = ((DateTimeOffset)to).ToUnixTimeSeconds();

            ReportsProvider.StartReport(Reports.SuccessCalls, _amo, _processQueue, _gSheets, dateFrom, dateTo);

            return(Ok("Requested."));
        }
Пример #4
0
        [HttpGet("{to}")]                                                                                                                //Запрашиваем отчёт для диапазона дат
        public IActionResult CorporateSales(string to)
        {
            if (!long.TryParse(to, out long dateTo))
            {
                return(BadRequest("Incorrect dates"));
            }

            var dates = GetDates(dateTo);

            ReportsProvider.StartReport(Reports.CorporateSales, _amo, _processQueue, _gSheets, dates.Item1, dates.Item2);

            return(Ok("Requested."));
        }
Пример #5
0
        public IActionResult CompaniesLastContacts()
        {
            ReportsProvider.StartReport(Reports.CompaniesLastContacts, _amo, _processQueue, _gSheets, 0, 0);

            return(Ok("Requested."));
        }
Пример #6
0
        public IActionResult AbandonedCompanies()
        {
            ReportsProvider.StartReport(Reports.AbandonedCompanies, _amo, _processQueue, _gSheets, 0, 0);

            return(Ok("Requested."));
        }