using AutoTurnOver.DB;
using AutoTurnOver.Services;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using ResetOutofstock;
using System;
using System.Threading.Tasks;

namespace ShortagePush
{
    class Program
    {
        static async Task Main(string[] args)
        {
            Console.WriteLine("推送缺货数据服务");

            try
            {

                //new ReportServices().ShortagePushEbay();

                //new ReportServices().ShortagePushEbay(true, true);
                //new ReportServices().ShortagePushEbay(true);
                //new ReportServices().ReturnGoodsPush();
                //new ReportServices().ShortagePushEbay();
                //new ReportServices().PPSReturnGoodsPush("walmart");

                //new ReportServices().ShortagePushEbay(true);
                //new ReportServices().PPSReturnGoodsPush("walmart");
                //new ReportServices().ShortagePushEbay();
            }
            catch (Exception ex)
            {

                throw;
            }
           
            //new ReportServices().ShortagePush();
            //new ReportServices().ShortagePush(platform: "walmart");
            //new ReportServices().ShortagePush();
            var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
            {
                services.AddHostedService<ShortagePushBackgroundService>();
                services.AddHostedService<PPSPushBackgrounService>();
            });

            await builder.RunConsoleAsync();
        }
    }
}
