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

namespace Bailun.DC.DailyPayAndIncoming
{
    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();
        }

        //static void Main(string[] args)
        //{
        //    var _services = new Services();

        //    var start = DateTime.Parse("2020-01-01");
        //    while (start < DateTime.Now)
        //    {
        //        Console.WriteLine(start);
        //        _services.Init(start, start.AddDays(1));
        //        _services.SaveMoneyFlowCount(start, start.AddDays(1));
        //        start = start.AddDays(1);
        //    }
        //}
    }
}
