Files
FsToolbox/Cli/Program.cs

43 lines
1.3 KiB
C#

using System.Net.Http;
using System.Net.Http.Json;
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
using FsToolbox.Cli;
using FsToolbox.Cli.Helper;
using NLog;
// See https://aka.ms/new-console-template for more information
LoggingService.Initialize();
var logger = LoggingService.GetLogger("FsToolbox.Cli.Program");
using var httpClient = new HttpClient();
// Show menu for the user to choose from the two tasks
logger.Info("Choose a task to execute:");
logger.Info("1. Check Aldi Memberships");
logger.Info("2. Confirm all Unconfirmed Pickups for Lindenberg");
logger.Info("3. Analyze slot unregistrations for region Siegen");
logger.Info("4. Analyze early slot registrations (calendar interval)");
logger.Info("Enter the number of the task to execute (or any other key to exit): ");
var choice = Console.ReadLine();
switch (choice)
{
case "1":
await CustomTasks.CheckAldiMembershipsAsync(httpClient);
break;
case "2":
await CustomTasks.ConfirmUnconfirmedPickupsLindenbergAsync(httpClient);
break;
case "3":
await CustomTasks.AnalyzeSlotUnregistrationsAsync(httpClient);
break;
case "4":
await CustomTasks.AnalyzeEarlySlotRegistrationsAsync(httpClient);
break;
default:
logger.Info("Exiting...");
break;
}