forked from ddrilling/AsbCloudServer
Split BackgroundWorkController
This commit is contained in:
parent
d7aea0f583
commit
c5ee0eeb39
@ -9,17 +9,16 @@ namespace AsbCloudWebApi.Controllers
|
||||
[Route("api/[controller]")]
|
||||
[Authorize]
|
||||
[ApiController]
|
||||
public class BackgroundWork : ControllerBase
|
||||
public class BackgroundWorkController : ControllerBase
|
||||
{
|
||||
private readonly BackgroundWorker backgroundWorker;
|
||||
|
||||
public BackgroundWork(BackgroundWorker backgroundWorker)
|
||||
public BackgroundWorkController(BackgroundWorker backgroundWorker)
|
||||
{
|
||||
this.backgroundWorker = backgroundWorker;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
//[ProducesResponseType(typeof(IEnumerable<DepositDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||
public IActionResult GetAll()
|
||||
{
|
||||
var result = new {
|
||||
@ -30,5 +29,19 @@ namespace AsbCloudWebApi.Controllers
|
||||
};
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
[HttpGet("Current")]
|
||||
public IActionResult GetCurrent()
|
||||
{
|
||||
var result = (BackgroundWorkDto?)backgroundWorker.CurrentWork;
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
[HttpGet("Failed")]
|
||||
public IActionResult GetFelled()
|
||||
{
|
||||
var result = backgroundWorker.WorkStore.Felled.Select(work => (BackgroundWorkDto)work);
|
||||
return Ok(result);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user