diff options
Diffstat (limited to 'src/slskd/Application/Management/API/Controllers/ApplicationController.cs')
| -rw-r--r-- | src/slskd/Application/Management/API/Controllers/ApplicationController.cs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/slskd/Application/Management/API/Controllers/ApplicationController.cs b/src/slskd/Application/Management/API/Controllers/ApplicationController.cs index ddac832a..dd115786 100644 --- a/src/slskd/Application/Management/API/Controllers/ApplicationController.cs +++ b/src/slskd/Application/Management/API/Controllers/ApplicationController.cs @@ -22,7 +22,6 @@ namespace slskd.Management.API using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Hosting; - using Soulseek; /// <summary> /// Application. @@ -34,16 +33,27 @@ namespace slskd.Management.API [Consumes("application/json")] public class ApplicationController : ControllerBase { - public ApplicationController(ISoulseekClient client, IHostApplicationLifetime lifetime) + public ApplicationController(IManagementService managementService, IHostApplicationLifetime lifetime) { - Client = client; + Management = managementService; Lifetime = lifetime; } - private ISoulseekClient Client { get; } + private IManagementService Management { get; } private IHostApplicationLifetime Lifetime { get; } /// <summary> + /// Gets the current state of the application. + /// </summary> + /// <returns></returns> + [HttpGet] + [Authorize] + public IActionResult State() + { + return Ok(Management.ApplicationState); + } + + /// <summary> /// Stops the application. /// </summary> /// <returns></returns> |
