mirror of
https://github.com/volodymyrsmirnov/MalwareMultiScan.git
synced 2025-08-24 05:22:22 +00:00
34 lines
987 B
C#
34 lines
987 B
C#
using System.Threading.Tasks;
|
|
using MalwareMultiScan.Api.Data.Models;
|
|
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 ScanResultService _scanResultService;
|
|
|
|
public ScanResultsController(ScanResultService scanResultService)
|
|
{
|
|
_scanResultService = scanResultService;
|
|
}
|
|
|
|
[HttpGet("{id}")]
|
|
[ProducesResponseType(typeof(ScanResult), StatusCodes.Status200OK)]
|
|
public async Task<IActionResult> Index(string id)
|
|
{
|
|
var scanResult = await _scanResultService.GetScanResult(id);
|
|
|
|
if (scanResult == null)
|
|
return NotFound();
|
|
|
|
return Ok(scanResult);
|
|
}
|
|
}
|
|
} |