mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-02 01:01:10 +00:00
Replaces MVC with FastEndpoints in Lumina.Presentation.Api
This commit is contained in:
1 parent
b1a20716df
commit
c7b8bc2f1c
519 files changed
+15329
-8539
No files matched your search
@@ -0,0 +1,38 @@
|
||||
#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() } });
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user