hanyadikhetvan-dotnethf/HanyadikHetVan/Controllers/V1/HanyadikHetVanController.cs

38 lines
954 B
C#
Raw Normal View History

2021-05-03 15:56:38 +02:00
using HanyadikHetVan.DTO;
using HanyadikHetVan.Services;
using Microsoft.AspNetCore.Mvc;
2021-05-19 04:33:53 +02:00
using System.Net.Mime;
2021-05-03 15:56:38 +02:00
2021-05-19 04:33:53 +02:00
namespace HanyadikHetVan.Controllers.V1
2021-05-03 15:56:38 +02:00
{
[ApiController]
2021-05-19 04:33:53 +02:00
[ApiVersion("1.0")]
[Route("api/v{version:apiVersion}/[controller]")]
public class HanyadikHetVanController : Controller
2021-05-03 15:56:38 +02:00
{
private readonly HanyadikHetVanJsonService _jsonservice;
private readonly HanyadikHetVanService _service;
public HanyadikHetVanController(HanyadikHetVanJsonService jsonservice, HanyadikHetVanService service)
{
_jsonservice = jsonservice;
_service = service;
}
2021-05-17 22:53:27 +02:00
[HttpGet("json")]
2021-05-19 04:33:53 +02:00
[Produces(MediaTypeNames.Application.Json)]
2021-05-03 15:56:38 +02:00
public HanyadikHetVanDTO GetJson()
{
return _jsonservice.HanyadikHetVan();
}
[HttpGet]
public int Get()
{
return _service.HanyadikHetVan();
}
}
}