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

namespace Bailun.DC.DailyBorrowFee
{
    class Program
    {
        /// <summary>
        /// 每日借支单待还金额
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        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.Now;

        //    start = DateTime.Parse(start.AddDays(-1).ToShortDateString());

        //    _services.Init(start);
        //}

    }
}
