mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-01 23:01:10 +00:00
39 lines
1.5 KiB
C#
39 lines
1.5 KiB
C#
#region ========================================================================= USING =====================================================================================
|
|
using Lumina.Presentation.Web.Common.Api;
|
|
using Lumina.Presentation.Web.Common.Models.FileSystemManagement;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
#endregion
|
|
|
|
namespace Lumina.Presentation.Web.Controllers.FileSystemManagement;
|
|
|
|
/// <summary>
|
|
/// Controller for managing file systems.
|
|
/// </summary>
|
|
[Route("/file-system")]
|
|
public class FileSystemController : Controller
|
|
{
|
|
private readonly IApiHttpClient _apiHttpClient;
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="FileSystemController"/> class.
|
|
/// </summary>
|
|
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
|
|
public FileSystemController(IApiHttpClient apiHttpClient)
|
|
{
|
|
_apiHttpClient = apiHttpClient;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the type of the file system.
|
|
/// </summary>
|
|
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
|
[HttpGet("get-type")]
|
|
public async Task<IActionResult> GetType(CancellationToken cancellationToken)
|
|
{
|
|
FileSystemTypeModel response = await _apiHttpClient.GetAsync<FileSystemTypeModel>($"file-system/get-type", cancellationToken: cancellationToken);
|
|
return Json(new { success = true, data = new { platformType = response.PlatformType.ToString() } });
|
|
}
|
|
}
|