using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Threading.Tasks;

namespace Bailun.DC.DailyItemNoAdGMV
{
    /// <summary>
    /// Item id 的广告GMV
    /// </summary>
    class Program
    {
        static async Task Main(string[] args)
        {
            //Console.WriteLine("获取ItemNo的广告GMV!");

            Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
            {
                services.AddHostedService<Services>();
            });

            await builder.RunConsoleAsync();

            //var _services = new Services();
            //var day = DateTime.Parse("2020-10-01");
            //while(day.AddDays(1)<DateTime.Now)
            //{
            //    _services.Init(day);
            //    day = day.AddDays(1);
            //}

        }
    }
}
