using System.Text.RegularExpressions;
using YLErp.DBModels.Consts;
using YLErp.Modules.CalculationModule;
using YLErp.Modules.PricingModule;
using YLErp.Modules.UnderlyingModule;
using YLErp.Modules.VolatilityModule;
using YLErp.Web.WebAPI.Models;
namespace YLErp.Web.WebAPI.Controllers
{
///
/// 标的数据
///
public class UnderlyingController : BaseController
{
///
/// 获取标的建议列表
///
[HttpPost("m/api/underlying/suggest-items")]
public JsonResult GetSuggestions(UnderlyingSuggestionRequest req)
{
var reqConv = new UnderlyingSelectRequest();
if (req != null)
{
reqConv.FilterCode = req.FilterCode;
reqConv.VarietyId = req.VarietyId;
if (req.Scenario == "定价")
{
reqConv.UsePinYinFilter = true;
}
}
var items = new UnderlyingSelectService(CurUser).GetSelectItems(reqConv);
return JsonSuccess(items);
}
///
/// 获取标的价格
///
[HttpPost("m/api/underlying/spot-price")]
public JsonResult GetSpotPrice(UnderlyingSpotPriceRequest req)
{
var result = new UnderlyingSpotPriceService(CurUser).GetSpotPrice(req);
return JsonSuccess(result);
}
///
/// 获取标的分红率
///
[HttpPost("m/api/underlying/dividenrate")]
public JsonResult GetDividenRate(UnderlyingDividenRateRequest req)
{
var result = new UnderlyingDividenRateService(CurUser).GetDividenRate(req);
return JsonSuccess(result);
}
}
}