about summary refs log tree commit diff
path: root/BugMine.CLI/InteractiveClient.cs
blob: e2fc3e49dc08f3cd1ed2d514f007ffe39b5e8c96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System.Text.Json;
using ArcaneLibs.Extensions;
using BugMine.CLI.Interfaces;
using BugMine.CLI.TUIMenus;
using BugMine.Web.Classes;
using LibMatrix.Responses;
using LibMatrix.Services;

namespace BugMine.CLI;

public class InteractiveClient(ILogger<InteractiveClient> logger, BugMineClient client, MainTUIMenu mainMenu) : BackgroundService {
    private readonly ILogger<InteractiveClient> _logger = logger;

    protected override async Task ExecuteAsync(CancellationToken stoppingToken) {
        while (!stoppingToken.IsCancellationRequested) {
            //             Console.WriteLine("""
            //                               1) List all projects
            //                               2) Mass create projects
            //                               3) Destroy all projects
            //                               4) Get room count
            //                               5) Summarize all projects
            //                               6) Mass create regular rooms
            //
            //                               L) Logout
            //                               Q) Quit
            //                               """);
            //             
            //             var input = Console.ReadKey();
            //             Console.WriteLine();
            //             switch (input.Key) {
            //                 
            //                 case ConsoleKey.L: {
            //                     File.Delete("auth.json");
            //                     await ExecuteAsync(stoppingToken);
            //                     return;
            //                 }
            //                 case ConsoleKey.Q: {
            //                     Environment.Exit(0);
            //                     return;
            //                 }
            //             }
            await mainMenu.Execute();
        }
    }
}