#region ========================================================================= USING ===================================================================================== using Lumina.Presentation.Web.Common.Api; using Lumina.Presentation.Web.Common.Models.FileManagement; using Microsoft.AspNetCore.Mvc; using System.Threading; using System.Threading.Tasks; #endregion namespace Lumina.Presentation.Web.Controllers.FileManagement; /// /// Controller for managing file system drives. /// [Route("[controller]")] public class DrivesController : Controller { private readonly IApiHttpClient _apiHttpClient; /// /// Initializes a new instance of the class. /// /// Injected service for interactions with the API. public DrivesController(IApiHttpClient apiHttpClient) { _apiHttpClient = apiHttpClient; } /// /// Controller action for getting the list of all file system drives. /// /// Cancellation token that can be used to stop the execution. [HttpGet("get-drives")] public async Task GetDrives(CancellationToken cancellationToken) { FileSystemTreeNodeModel[] response = await _apiHttpClient.GetAsync($"drives/get-drives", cancellationToken: cancellationToken); return Json(new { success = true, data = new { drives = response } }); } }