kreta/Kreta.WebApi/Ellenorzo/Kreta.Ellenorzo.WebApi/VN/Controllers/IntezmenyController.cs
2024-03-13 00:33:46 +01:00

41 lines
2.2 KiB
C#

using System;
using System.Net;
using System.Web.Http;
using Kreta.Ellenorzo.BL.VN.Intezmeny;
using Kreta.Ellenorzo.Dto.VN.Exception;
using Kreta.Ellenorzo.Dto.VN.Intezmeny;
using Kreta.Ellenorzo.Enums;
using Kreta.Ellenorzo.Web.FilterAttributes;
using Kreta.Ellenorzo.WebApi.FilterAttributes;
using Kreta.Ellenorzo.WebApi.VN.Documentation;
using Kreta.Ellenorzo.WebApi.VN.Logic;
using Swashbuckle.Examples;
using Swashbuckle.Swagger.Annotations;
namespace Kreta.Ellenorzo.WebApi.VN.Controllers
{
[ApiKeyAuthorization]
[IdpAuthorize(FelhasznaloSzerepkor.Tanulo, FelhasznaloSzerepkor.Gondviselo)]
[RoutePrefix(Constants.RoutePrefix)]
[SwaggerResponse(HttpStatusCode.InternalServerError, DescriptionLookUp.IsmeretlenHibaTortentResponseLeiras, typeof(EllenorzoExceptionResponseDto))]
[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.Conflict, DescriptionLookUp.TanevetValtottAzIntezmeny, typeof(EllenorzoExceptionResponseDto))]
[SwaggerResponseExample(HttpStatusCode.Conflict, typeof(IntezmenyMarTanevetValtottExample))]
public class IntezmenyController : ApiController
{
/// <summary>
/// Saját intézmény adatai
/// </summary>
[HttpGet, Route("Sajat/Intezmenyek")]
[SwaggerResponse(HttpStatusCode.OK, DescriptionLookUp.IntezmenyAdatai + DescriptionOneNote.Intezmeny, typeof(IntezmenyListResponseDto))]
[SwaggerResponseExample(HttpStatusCode.OK, typeof(DummyListExampleProvider<IntezmenyController, IntezmenyListResponseDto>))]
public IntezmenyListResponseDto GetIntezmeny()
{
return ((IntezmenyFacade)Activator.CreateInstance(typeof(IntezmenyFacade), FelhasznaloLogic.GetFelhasznalo())).GetIntezmeny();
}
}
}