diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-08-03 09:25:10 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-08-03 09:25:10 -0500 |
| commit | 43f3bf2d128dc7e44043a8ef2199d75cdb0d3d4b (patch) | |
| tree | 8a5f8c25b7e63b4a684d04500a0f6e4d188d32c3 /src/slskd/Application/Management/API/Controllers/ApplicationController.cs | |
| parent | 71815c51cb305ba97a7732be52509eb64fcd4aa3 (diff) | |
| download | slskd-43f3bf2d128dc7e44043a8ef2199d75cdb0d3d4b.tar.gz | |
add plumbing to rescan shares via API
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..43029aa5 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.GetServiceState()); + } + + /// <summary> /// Stops the application. /// </summary> /// <returns></returns> |
