using HanyadikHetVan.DTO;
using HanyadikHetVan.Services;
using Microsoft.AspNetCore.Mvc;
using System.Net.Mime;

namespace HanyadikHetVan.Controllers.V1
{
    [ApiController]
    [ApiVersion("1.0")]
    [Route("api/v{version:apiVersion}/[controller]")]
    public class HanyadikHetVanController : Controller
    {

        private readonly HanyadikHetVanJsonService _jsonservice;
        private readonly HanyadikHetVanService _service;


        public HanyadikHetVanController(HanyadikHetVanJsonService jsonservice, HanyadikHetVanService service)
        {
            _jsonservice = jsonservice;
            _service = service;
        }

        [HttpGet("json")]
        [Produces(MediaTypeNames.Application.Json)]
        public HanyadikHetVanDTO GetJson()
        {
            return _jsonservice.HanyadikHetVan();
        }

        [HttpGet]
        public int Get()
        {
            return _service.HanyadikHetVan();
        }
    }
}
