﻿namespace Temp.Monitor.Api.Mock.Controllers
{
    using Microsoft.AspNetCore.Mvc;
    using Repository;

    [Route("api/[controller]")]
    public class TempController : Controller
    {
        public TempController(ITempDataRepository temperatureData)
        {
            TemperatureData = temperatureData;
        }

        public ITempDataRepository TemperatureData { get; set; }

        [HttpGet("{id}")]
        public IActionResult Get(string id)
        {
            if(string.IsNullOrWhiteSpace(id))
                return BadRequest();

            return Ok(TemperatureData.GetAll(id));
        }
    }
}