IDataAccess.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Collections.Generic;
  3. using MuchInfo.Chart.Data.EnumTypes;
  4. using MuchInfo.Chart.Data.Interfaces;
  5. namespace MuchInfo.Chart.DataAccess
  6. {
  7. /// <summary>
  8. /// 请求历史周期数据点(1分钟线,5分钟线,30分钟线,240分钟线,日线...)
  9. /// </summary>
  10. public interface IDataAccess
  11. {
  12. #region Methods
  13. /// <summary>
  14. /// 获取数据
  15. /// </summary>
  16. /// <param name="symbol">商品代码</param>
  17. /// <param name="cycleType">周期类型</param>
  18. /// <param name="startTime">起始时间</param>
  19. /// <param name="endTime">结束时间</param>
  20. /// <param name="totalCount">记录条数</param>
  21. IEnumerable<IBarDataPoint> GetDataPoints(string symbol, CycleType cycleType, DateTime startTime, DateTime endTime, int totalCount);
  22. /// <summary>
  23. /// 获取数据
  24. /// </summary>
  25. /// <param name="symbol">商品代码</param>
  26. /// <param name="timeSpan">The time span.</param>
  27. /// <param name="startTime">起始时间</param>
  28. /// <param name="endTime">结束时间</param>
  29. /// <param name="totalCount">记录条数</param>
  30. /// <returns>IEnumerable{IBarDataPoint}.</returns>
  31. IEnumerable<IBarDataPoint> GetDataPoints(string symbol, TimeSpan timeSpan, DateTime startTime, DateTime endTime, int totalCount);
  32. /// <summary>
  33. /// 保存数据
  34. /// </summary>
  35. /// <param name="symbol">商品代码</param>
  36. /// <param name="cycleType">周期类型</param>
  37. /// <param name="dataPoints">保存的数据</param>
  38. void SaveDataPoints(string symbol, CycleType cycleType, IList<IBarDataPoint> dataPoints);
  39. /// <summary>
  40. /// 保存数据
  41. /// </summary>
  42. /// <param name="symbol">商品代码</param>
  43. /// <param name="timeSpan">The time span.</param>
  44. /// <param name="dataPoints">保存的数据</param>
  45. void SaveDataPoints(string symbol, TimeSpan timeSpan, IList<IBarDataPoint> dataPoints);
  46. #endregion Methods
  47. }
  48. }