mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 04:11:10 +00:00
Swiches Client Web app from Blazor to ASP.NET Core MVC
This commit is contained in:
1 parent
cf94676666
commit
9a7d4c607d
35 files changed
+4066
-1853
No files matched your search
@@ -0,0 +1,44 @@
|
||||
#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;
|
||||
|
||||
/// <summary>
|
||||
/// Controller for managing file systems.
|
||||
/// </summary>
|
||||
[Route("/file-system")]
|
||||
public class FileSystemController : Controller
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IApiHttpClient _apiHttpClient;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <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;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
/// <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() } });
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Reference in new issue
Block a user