30 lines
889 B
C#
Executable File
30 lines
889 B
C#
Executable File
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)
|
|
{
|
|
try
|
|
{
|
|
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("[{0:G}][WatchListController::GetWatchList]", DateTime.Now));
|
|
if (!Authorizations.GetInstance().IsAuthorized(token)) return null;
|
|
return WatchListDA.GetWatchList(watchList);
|
|
}
|
|
catch(Exception exception)
|
|
{
|
|
MDTrace.WriteLine(LogLevel.DEBUG,$"Exception:{exception.ToString()}");
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|