Add MarketDataServer
This commit is contained in:
32
MarketDataServer/Controllers/PriceIndexController.cs
Executable file
32
MarketDataServer/Controllers/PriceIndexController.cs
Executable file
@@ -0,0 +1,32 @@
|
||||
using MarketData.MarketDataModel;
|
||||
using MarketData.DataAccess;
|
||||
using MarketDataServer.Authorization;
|
||||
using MarketData;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using LogLevel = MarketData.LogLevel;
|
||||
|
||||
namespace MarketDataServer.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/[controller]/[action]")]
|
||||
public class PriceIndexController : ControllerBase
|
||||
{
|
||||
//http://localhost:8000/api/PriceIndex/GetDistnctPriceIndices
|
||||
[HttpGet(Name = "GetDistinctPriceIndices")]
|
||||
public IEnumerable<String> GetDistinctPriceIndices(String token)
|
||||
{
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("[{0:G}][PriceIndexController::GetDistinctPriceIndices]",DateTime.Now));
|
||||
if (!Authorizations.GetInstance().IsAuthorized(token)) return null;
|
||||
return ConsumerPriceIndexDA.GetDistinctIndices();
|
||||
}
|
||||
|
||||
[HttpGet(Name = "GetConsumerPriceIndex")]
|
||||
public IEnumerable<PriceIndex> GetConsumerPriceIndex(String token,String indexCode)
|
||||
{
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("[{0:G}][PriceIndexController::GetOpenPositionsWithDescriptionAsOf]",DateTime.Now));
|
||||
if (!Authorizations.GetInstance().IsAuthorized(token)) return null;
|
||||
PriceIndices priceIndices=ConsumerPriceIndexDA.GetConsumerPriceIndex(indexCode);
|
||||
return priceIndices;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user