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

namespace Bailun.DC.DailyItemNoProfitRate
{
    class Program
    {
        static async Task Main(string[] args)
        {

            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 _service = new Services();
            //var day = DateTime.Parse(DateTime.Now.AddDays(-2).ToShortDateString());
            //_service.Init(day.AddDays(-20), day);
            //_service.OneDayItemNoProfitRate(day.AddDays(-1), day);
        }
    }
}
