diff --git a/modules/JiShe.CollectBus.IoTDB/Attribute/EntityTypeAttribute.cs b/modules/JiShe.CollectBus.IoTDB/Attribute/EntityTypeAttribute.cs
new file mode 100644
index 0000000..3610c00
--- /dev/null
+++ b/modules/JiShe.CollectBus.IoTDB/Attribute/EntityTypeAttribute.cs
@@ -0,0 +1,19 @@
+using JiShe.CollectBus.IoTDB.Enums;
+
+namespace JiShe.CollectBus.IoTDB.Attribute
+{
+ ///
+ /// IoTDB实体类型特性
+ ///
+ [AttributeUsage(AttributeTargets.Class)]
+ public class EntityTypeAttribute : System.Attribute
+ {
+ public EntityTypeEnum EntityType { get; }
+
+
+ public EntityTypeAttribute(EntityTypeEnum entityType)
+ {
+ EntityType = entityType;
+ }
+ }
+}
diff --git a/modules/JiShe.CollectBus.IoTDB/Attribute/SingleMeasuringAttribute.cs b/modules/JiShe.CollectBus.IoTDB/Attribute/SingleMeasuringAttribute.cs
index cebb85a..5f0ca07 100644
--- a/modules/JiShe.CollectBus.IoTDB/Attribute/SingleMeasuringAttribute.cs
+++ b/modules/JiShe.CollectBus.IoTDB/Attribute/SingleMeasuringAttribute.cs
@@ -1,7 +1,7 @@
namespace JiShe.CollectBus.IoTDB.Attribute
{
///
- /// 用于标识当前实体为单侧点模式,单侧点模式只有一个Filed标识字段,类型是Tuple,Item1=>测点名称,Item2=>测点值,泛型
+ /// 用于标识当前实体为单侧点模式,单侧点模式只有一个Filed标识字段,类型是Tuple,Item1=>测点名称,Item2=>测点值,泛型
///
[AttributeUsage(AttributeTargets.Property)]
public class SingleMeasuringAttribute : System.Attribute
diff --git a/modules/JiShe.CollectBus.IoTDB/Attribute/TableNameOrTreePathAttribute.cs b/modules/JiShe.CollectBus.IoTDB/Attribute/TableNameOrTreePathAttribute.cs
new file mode 100644
index 0000000..1b4f4f0
--- /dev/null
+++ b/modules/JiShe.CollectBus.IoTDB/Attribute/TableNameOrTreePathAttribute.cs
@@ -0,0 +1,18 @@
+using JiShe.CollectBus.IoTDB.Enums;
+
+namespace JiShe.CollectBus.IoTDB.Attribute
+{
+ ///
+ /// IoTDB实体存储路径或表名称,一般用于已经明确的存储路径或表名称,例如日志存储
+ ///
+ [AttributeUsage(AttributeTargets.Class)]
+ public class TableNameOrTreePathAttribute : System.Attribute
+ {
+ public string TableNameOrTreePath { get; }
+
+ public TableNameOrTreePathAttribute(string tableNameOrTreePath)
+ {
+ TableNameOrTreePath = tableNameOrTreePath;
+ }
+ }
+}
diff --git a/modules/JiShe.CollectBus.IoTDB/CollectBusIoTDBModule.cs b/modules/JiShe.CollectBus.IoTDB/CollectBusIoTDBModule.cs
index 2cce113..6d26bdc 100644
--- a/modules/JiShe.CollectBus.IoTDB/CollectBusIoTDBModule.cs
+++ b/modules/JiShe.CollectBus.IoTDB/CollectBusIoTDBModule.cs
@@ -16,7 +16,7 @@ public class CollectBusIoTDbModule : AbpModule
var configuration = context.Services.GetConfiguration();
Configure(options => { configuration.GetSection(nameof(IoTDbOptions)).Bind(options); });
- // 注册上下文为Scoped
- context.Services.AddScoped();
+ //// 注册上下文为Scoped
+ //context.Services.AddScoped();
}
}
\ No newline at end of file
diff --git a/modules/JiShe.CollectBus.IoTDB/Context/IoTDBRuntimeContext.cs b/modules/JiShe.CollectBus.IoTDB/Context/IoTDBRuntimeContext.cs
index f1619ac..ef68325 100644
--- a/modules/JiShe.CollectBus.IoTDB/Context/IoTDBRuntimeContext.cs
+++ b/modules/JiShe.CollectBus.IoTDB/Context/IoTDBRuntimeContext.cs
@@ -1,23 +1,24 @@
using JiShe.CollectBus.IoTDB.Options;
using Microsoft.Extensions.Options;
+using Volo.Abp.DependencyInjection;
namespace JiShe.CollectBus.IoTDB.Context
{
///
/// IoTDB SessionPool 运行时上下文
///
- public class IoTDbRuntimeContext
+ public class IoTDBRuntimeContext: IScopedDependency
{
private readonly bool _defaultValue;
- public IoTDbRuntimeContext(IOptions options)
+ public IoTDBRuntimeContext(IOptions options)
{
_defaultValue = options.Value.UseTableSessionPoolByDefault;
UseTableSessionPool = _defaultValue;
}
///
- /// 是否使用表模型存储, 默认false,使用tree模型存储
+ /// 存储模型切换标识,是否使用table模型存储, 默认为false,标识tree模型存储
///
public bool UseTableSessionPool { get; set; }
diff --git a/modules/JiShe.CollectBus.IoTDB/EnumInfo/EntityTypeEnum.cs b/modules/JiShe.CollectBus.IoTDB/EnumInfo/EntityTypeEnum.cs
new file mode 100644
index 0000000..26c6645
--- /dev/null
+++ b/modules/JiShe.CollectBus.IoTDB/EnumInfo/EntityTypeEnum.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JiShe.CollectBus.IoTDB.Enums
+{
+ ///
+ /// IoTDB实体类型枚举
+ ///
+ public enum EntityTypeEnum
+ {
+ ///
+ /// 树模型
+ ///
+ TreeModel = 1,
+
+ ///
+ /// 表模型
+ ///
+ TableModel = 2,
+ }
+}
diff --git a/modules/JiShe.CollectBus.IoTDB/Interface/IIoTDBProvider.cs b/modules/JiShe.CollectBus.IoTDB/Interface/IIoTDBProvider.cs
index 02ac3ee..82a0d47 100644
--- a/modules/JiShe.CollectBus.IoTDB/Interface/IIoTDBProvider.cs
+++ b/modules/JiShe.CollectBus.IoTDB/Interface/IIoTDBProvider.cs
@@ -1,4 +1,5 @@
using JiShe.CollectBus.Common.Models;
+using JiShe.CollectBus.IoTDB.Model;
using JiShe.CollectBus.IoTDB.Options;
using JiShe.CollectBus.IoTDB.Provider;
@@ -31,6 +32,15 @@ namespace JiShe.CollectBus.IoTDB.Interface
///
Task BatchInsertAsync(IEnumerable entities) where T : IoTEntity;
+ ///
+ /// 批量插入数据
+ ///
+ ///
+ /// 设备元数据
+ ///
+ ///
+ Task BatchInsertAsync(DeviceMetadata deviceMetadata,IEnumerable entities) where T : IoTEntity;
+
///
/// 删除数据
@@ -38,7 +48,14 @@ namespace JiShe.CollectBus.IoTDB.Interface
///
///
///
- Task