mirror of
https://github.com/volodymyrsmirnov/MalwareMultiScan.git
synced 2025-08-25 14:01:13 +00:00
change the communication protocol to RMQ
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using MalwareMultiScan.Api.Data.Models;
|
||||
using MalwareMultiScan.Api.Services;
|
||||
using MalwareMultiScan.Shared.Data.Responses;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
@@ -11,21 +12,23 @@ namespace MalwareMultiScan.Api.Controllers
|
||||
[Produces("application/json")]
|
||||
public class ScanResultsController : Controller
|
||||
{
|
||||
private readonly ScanResultsService _scanResultsService;
|
||||
private readonly ScanResultService _scanResultService;
|
||||
|
||||
public ScanResultsController(ScanResultsService scanResultsService)
|
||||
public ScanResultsController(ScanResultService scanResultService)
|
||||
{
|
||||
_scanResultsService = scanResultsService;
|
||||
_scanResultService = scanResultService;
|
||||
}
|
||||
|
||||
[HttpPost("{id}")]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
public async Task<IActionResult> Index(string id, [FromBody] ResultResponse result)
|
||||
|
||||
[HttpGet("{id}")]
|
||||
[ProducesResponseType(typeof(ScanResult), StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> Index(string id)
|
||||
{
|
||||
await _scanResultsService.UpdateScanResultForBackend(
|
||||
id, result.Backend, true, result.Success, result.Threats);
|
||||
|
||||
return NoContent();
|
||||
var scanResult = await _scanResultService.GetScanResult(id);
|
||||
|
||||
if (scanResult == null)
|
||||
return NotFound();
|
||||
|
||||
return Ok(scanResult);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user