mirror of
https://github.com/volodymyrsmirnov/MalwareMultiScan.git
synced 2025-08-24 05:22:22 +00:00
31 lines
972 B
C#
31 lines
972 B
C#
|
using System.Threading.Tasks;
|
||
|
using MalwareMultiScan.Api.Services;
|
||
|
using MalwareMultiScan.Shared.Data.Responses;
|
||
|
using Microsoft.AspNetCore.Http;
|
||
|
using Microsoft.AspNetCore.Mvc;
|
||
|
|
||
|
namespace MalwareMultiScan.Api.Controllers
|
||
|
{
|
||
|
[ApiController]
|
||
|
[Route("results")]
|
||
|
[Produces("application/json")]
|
||
|
public class ScanResultsController : Controller
|
||
|
{
|
||
|
private readonly ScanResultsService _scanResultsService;
|
||
|
|
||
|
public ScanResultsController(ScanResultsService scanResultsService)
|
||
|
{
|
||
|
_scanResultsService = scanResultsService;
|
||
|
}
|
||
|
|
||
|
[HttpPost("{id}")]
|
||
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||
|
public async Task<IActionResult> Index(string id, [FromBody] ResultResponse result)
|
||
|
{
|
||
|
await _scanResultsService.UpdateScanResultForBackend(
|
||
|
id, result.Backend, true, result.Success, result.Threats);
|
||
|
|
||
|
return NoContent();
|
||
|
}
|
||
|
}
|
||
|
}
|