#region ========================================================================= USING =====================================================================================
using Lumina.Application.Core.FileManagement.FileSystem.Queries.GetFileSystem;
using Lumina.Contracts.Responses.FileManagement;
using Lumina.Presentation.Api.Core.Controllers.Common;
using Mediator;
using Microsoft.AspNetCore.Mvc;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Api.Core.Controllers.FileManagement;
///
/// Controller for managing file systems.
///
[ApiVersion("1.0")]
[Route("api/v{version:apiVersion}/file-system")]
public class FileSystemController : ApiController
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly ISender _mediator;
#endregion
#region ====================================================================== CTOR =====================================================================================
///
/// Initializes a new instance of the class.
///
/// Injected service for mediating commands and queries.
public FileSystemController(ISender mediator)
{
_mediator = mediator;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
///
/// Gets the type of the file system.
///
/// Cancellation token that can be used to stop the execution.
[HttpGet("get-type")]
public async Task GetType(CancellationToken cancellationToken)
{
FileSystemTypeResponse platformType = await _mediator.Send(new GetFileSystemQuery(), cancellationToken).ConfigureAwait(false);
return Ok(platformType);
}
#endregion
}