Add project files.

This commit is contained in:
pkus
2025-01-24 13:37:01 +01:00
parent ee70a3c8af
commit ed726eea09
94 changed files with 4591 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using Microsoft.AspNetCore.Mvc;
using SytelineSaAppEfDataModel.Dtos;
using SytelineSaAppEfDataModel.Services;
namespace FaKrosnoApi.Controllers
{
[ApiController]
[Route("api/[controller]")]
public class ErrorLogController(IErrorLogService service) : Controller
{
[HttpGet]
public async Task<ActionResult<IEnumerable<ErrorLogDto>>> GetAll()
{
IEnumerable<ErrorLogDto?> errorLogs = await service.GetAll();
return Ok(errorLogs);
}
[HttpGet("by-order-number")]
public async Task<ActionResult<IEnumerable<ErrorLogDto>>> GetByCustomerOrderNumber([FromQuery] string customerOrderNumber)
{
var errorLogs = await service.GetByOrderNumber(customerOrderNumber);
return errorLogs.Any() ? Ok(errorLogs) : NotFound();
}
}
}