using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JiShe.CollectBus.ShardingStrategy
{
    /// <summary>
    /// 数据存储分片策略
    /// </summary>
    /// <typeparam name="TEntity"></typeparam>
    public interface IShardingStrategy<TEntity>
    {
        /// <summary>
        /// 获取指定时间对应的集合名
        /// </summary>
        /// <returns></returns>
        string GetCollectionName(DateTime dateTime);

        /// <summary>
        /// 获取当前时间对应的集合名
        /// </summary>
        /// <returns></returns>
        string GetCurrentCollectionName();

        /// <summary>
        /// 用于查询时确定目标集合
        /// </summary>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <returns></returns>
        IEnumerable<string> GetQueryCollectionNames(DateTime? startTime = null,
            DateTime? endTime = null);
    }
}
