mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 06:11:10 +00:00
Implements directory browser dialog, part 1: file system treeview
This commit is contained in:
1 parent
4a53348013
commit
4e4ecbbfca
318 files changed
+6012
-1184
No files matched your search
@@ -0,0 +1,46 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.FileManagement.FileSystem.Queries;
|
||||
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;
|
||||
|
||||
/// <summary>
|
||||
/// Controller for managing file systems.
|
||||
/// </summary>
|
||||
[ApiVersion("1.0")]
|
||||
[Route("api/v{version:apiVersion}/file-system")]
|
||||
public class FileSystemController : ApiController
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly ISender _mediator;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FileSystemController"/> class.
|
||||
/// </summary>
|
||||
/// <param name="mediator">Injected service for mediating commands and queries.</param>
|
||||
public FileSystemController(ISender mediator)
|
||||
{
|
||||
_mediator = mediator;
|
||||
}
|
||||
#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)
|
||||
{
|
||||
var platformType = await _mediator.Send(new GetFileSystemQuery(), cancellationToken).ConfigureAwait(false);
|
||||
return Ok(platformType);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Reference in new issue
Block a user