69 lines
2.3 KiB
C#
Raw Normal View History

2025-04-15 16:05:07 +08:00
using JiShe.CollectBus.Common.Models;
2025-04-21 14:20:49 +08:00
using JiShe.CollectBus.IoTDB.Model;
2025-04-17 20:28:50 +08:00
using JiShe.CollectBus.IoTDB.Options;
using JiShe.CollectBus.IoTDB.Provider;
2025-04-02 14:06:40 +08:00
2025-04-17 20:28:50 +08:00
namespace JiShe.CollectBus.IoTDB.Interface
2025-04-02 14:06:40 +08:00
{
/// <summary>
2025-04-07 16:44:25 +08:00
/// IoTDB数据源,数据库能同时存多个时序模型,但数据是完全隔离的,不能跨时序模型查询,通过连接字符串配置
2025-04-02 14:06:40 +08:00
/// </summary>
2025-04-21 10:17:40 +08:00
public interface IIoTDbProvider
2025-04-02 14:06:40 +08:00
{
2025-04-11 11:56:23 +08:00
///// <summary>
///// 切换 SessionPool
///// </summary>
///// <param name="useTableSession">是否使用表模型</param>
//void SwitchSessionPool(bool useTableSession);
2025-04-07 16:44:25 +08:00
2025-04-02 14:06:40 +08:00
/// <summary>
/// 插入数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="entity"></param>
/// <returns></returns>
2025-04-07 16:44:25 +08:00
Task InsertAsync<T>(T entity) where T : IoTEntity;
2025-04-02 14:06:40 +08:00
/// <summary>
/// 批量插入数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="entities"></param>
/// <returns></returns>
2025-04-07 16:44:25 +08:00
Task BatchInsertAsync<T>(IEnumerable<T> entities) where T : IoTEntity;
2025-04-03 15:38:31 +08:00
/// <summary>
/// 批量插入数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="deviceMetadata">设备元数据</param>
/// <param name="entities"></param>
/// <returns></returns>
Task BatchInsertAsync<T>(DeviceMetadata deviceMetadata,IEnumerable<T> entities) where T : IoTEntity;
2025-04-03 15:38:31 +08:00
/// <summary>
/// 删除数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="options"></param>
/// <returns></returns>
Task<object> DeleteAsync<T>(IoTDBQueryOptions options) where T : IoTEntity;
/// <summary>
/// 获取设备元数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
Task<DeviceMetadata> GetMetadata<T>() where T : IoTEntity;
2025-04-02 14:06:40 +08:00
/// <summary>
/// 查询数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="options"></param>
/// <returns></returns>
Task<BusPagedResult<T>> QueryAsync<T>(IoTDBQueryOptions options) where T : IoTEntity, new();
2025-04-02 14:06:40 +08:00
}
}