kreta/Kreta.WebApi/Naplo/Kreta.Naplo.WebApi/V3/Controllers/OraController.cs
2024-03-13 00:33:46 +01:00

41 lines
2.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Net;
using System.Web.Http;
using Kreta.Naplo.BusinessLogic.V3.Ora;
using Kreta.Naplo.Domain.V3.Enum;
using Kreta.Naplo.Dto.V3.Exception;
using Kreta.Naplo.Dto.V3.Ora;
using Kreta.Naplo.WebApi.FilterAttributes;
using Kreta.Naplo.WebApi.V3.Common.Logic;
using Kreta.Naplo.WebApi.V3.Documentation;
using Swashbuckle.Examples;
using Swashbuckle.Swagger.Annotations;
using static Kreta.Naplo.Dto.V3.Converter.ResponseModelConverter;
namespace Kreta.Naplo.WebApi.V3.Controllers
{
[ApiKeyAuthorization]
[IdpAuthorize(FelhasznaloSzerepkor.Tanar)]
[RoutePrefix(Constants.RoutePrefix + "/Ora")]
[SwaggerResponse(HttpStatusCode.InternalServerError, DescriptionLookUp.IsmeretlenHibaTortentResponseLeiras, typeof(NaploExceptionResponseDto))]
[SwaggerResponseExample(HttpStatusCode.InternalServerError, typeof(IsmeretlenHibaExample))]
[SwaggerResponse(HttpStatusCode.Unauthorized, DescriptionLookUp.JogosulatlanTokenLejartResponseLeiras, typeof(string))]
[SwaggerResponseExample(HttpStatusCode.Unauthorized, typeof(LejartTokenExample))]
[SwaggerResponse(HttpStatusCode.Forbidden, DescriptionLookUp.HozzaferesMegtagadvaResponseLeiras, typeof(string))]
[SwaggerResponseExample(HttpStatusCode.Forbidden, typeof(PermissionDeniedExample))]
[SwaggerResponse(HttpStatusCode.RequestTimeout, DescriptionLookUp.KeresTullepteMaxFutasiIdot, typeof(NaploExceptionResponseDto))]
[SwaggerResponseExample(HttpStatusCode.RequestTimeout, typeof(TimeOutExample))]
[SwaggerResponse(HttpStatusCode.Conflict, DescriptionLookUp.TanevetValtottAzIntezmeny, typeof(NaploExceptionResponseDto))]
[SwaggerResponseExample(HttpStatusCode.Conflict, typeof(IntezmenyMarTanevetValtottExample))]
public class OraController : ApiController
{
[HttpGet, Route("Feljegyzes")]
[SwaggerResponse(HttpStatusCode.OK, DescriptionLookUp.OraFeljegyzesResponseLeiras, typeof(OraFeljegyzesResponseDto))]
[SwaggerResponseExample(HttpStatusCode.OK, typeof(DummyExampleProvider<OraController, OraFeljegyzesResponseDto>))]
public List<OraFeljegyzesResponseDto> GetOraFeljegyzesek([FromUri] OraFeljegyzesRequestDto request)
{
return ModelToDto(((OraFacade)Activator.CreateInstance(typeof(OraFacade), FelhasznaloLogic.GetFelhasznalo())).GetOraFeljegyzesek(request));
}
}
}