using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using APT.Infrastructure.Api;
namespace APT.BaseData.Domain.IServices
{
    public interface IInfluxDataBaseService<T>: ICommonService
    {
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task<bool> SaveData(List<T> data);

        /// <summary>
        ///  获取数据
        /// </summary>
        /// <param name="ids">变量id</param>
        /// <param name="st"></param>
        /// <param name="et"></param>
        /// <returns></returns>
        Task<List<T>> GetDatas(List<Guid> ids, DateTime st, DateTime? et);

        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="id">变量id</param>
        /// <param name="st"></param>
        /// <param name="et"></param>
        /// <returns></returns>
        Task<List<T>> GetDatas(Guid id, DateTime st, DateTime? et);

        /// <summary>
        /// 清空数据
        /// </summary>
        /// <param name="id">变量id</param>
        /// <returns></returns>
        Task<bool> DeleteData(Guid id);

        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="id">变量id</param>
        /// <param name="st">开始时间</param>
        /// <param name="et">结束时间</param>
        /// <returns></returns>
        Task<bool> DeleteData(Guid id, DateTime? st, DateTime et);

        /// <summary>
        /// 获取点最后一条数据。
        /// </summary>
        /// <param name="id"></param>
        /// <param name="time"></param>
        /// <returns></returns>
        Task<T> GetLastData(Guid id, DateTime time);

        /// <summary>
        /// 获取点第一条数据。
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<T> GetFirstData(Guid id);
    }
}
