using MarketData;
using MarketData.DataAccess;
using MarketDataServer.Authorization;
using Microsoft.AspNetCore.Mvc;
using LogLevel = MarketData.LogLevel;

namespace MarketDataServer.Controllers
{
  [ApiController]
  [Route("api/[controller]/[action]")]
  public class WatchListController : ControllerBase
  {
    [HttpGet(Name = "GetWatchList")]
    public IEnumerable<String> GetWatchList(String token,String watchList)
    {
      MDTrace.WriteLine(LogLevel.DEBUG,String.Format("[{0:G}][WatchListController::GetWatchList]", DateTime.Now));
      if (!Authorizations.GetInstance().IsAuthorized(token)) return null;
      return WatchListDA.GetWatchList(watchList);
    }
  }
}
