public async Task <IActionResult> GetStockInfo( [FromQuery][Required][RegularExpression(@"[a-zA-Z]{2}\.\d{6}")] string id ) { var info = BaoStock.Fetch <StockInfo>(Api.StockInfo, (StockId)id); if (info.Type == StockInfo.SecurityType.Stock) { var extra = await Tushare.GetCompanyInformation(id); info.RegisteredCapital = extra.RegisterCapital; info.LegalRepresentative = extra.LegalRepresentative; info.GeneralManager = extra.GeneralManager; info.Secretary = extra.Secretary; info.EmployeeCount = extra.EmployeeCount; info.Province = extra.Province; info.City = extra.City; info.Office = extra.Office; info.Email = extra.Email; info.Website = extra.Website; info.BusinessScope = extra.BusinessScope; info.MainBusiness = extra.MainBusiness; info.Introduction = extra.Introduction; } return(Ok(info)); }
public IActionResult GetStockList([FromQuery] string type = "default", [FromQuery] DateTime?date = null) { date ??= DateTime.Now.Date; return(Ok(BaoStock.Fetch <StockBasicInfo[]>(Api.StockList, type, date))); }