From 8bfc6fa6dfa9d6f3917f131f2250440cecb0a0f4 Mon Sep 17 00:00:00 2001 From: ChenYi <296215406@outlook.com> Date: Tue, 29 Apr 2025 23:55:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=95=B0=E6=8D=AE=E9=80=9A?= =?UTF-8?q?=E9=81=93=E7=AE=A1=E7=90=86=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataChannels/IDataChannelManageService.cs | 15 ++++++ .../DataChannels/DataChannelManageService.cs | 50 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 services/JiShe.CollectBus.Application.Contracts/DataChannels/IDataChannelManageService.cs create mode 100644 services/JiShe.CollectBus.Application/DataChannels/DataChannelManageService.cs diff --git a/services/JiShe.CollectBus.Application.Contracts/DataChannels/IDataChannelManageService.cs b/services/JiShe.CollectBus.Application.Contracts/DataChannels/IDataChannelManageService.cs new file mode 100644 index 0000000..150b6f9 --- /dev/null +++ b/services/JiShe.CollectBus.Application.Contracts/DataChannels/IDataChannelManageService.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace JiShe.CollectBus.DataChannels +{ + /// + /// 数据通道管理服务 + /// + public interface IDataChannelManageService + { + } +} diff --git a/services/JiShe.CollectBus.Application/DataChannels/DataChannelManageService.cs b/services/JiShe.CollectBus.Application/DataChannels/DataChannelManageService.cs new file mode 100644 index 0000000..03cb24f --- /dev/null +++ b/services/JiShe.CollectBus.Application/DataChannels/DataChannelManageService.cs @@ -0,0 +1,50 @@ +using JiShe.CollectBus.Application.Contracts; +using JiShe.CollectBus.Common; +using JiShe.CollectBus.IoTDB.Context; +using JiShe.CollectBus.IoTDB.Interface; +using JiShe.CollectBus.Kafka.Internal; +using JiShe.CollectBus.Kafka.Producer; +using JiShe.CollectBus.Protocol.Interfaces; +using JiShe.CollectBus.Protocol.Services; +using JiShe.CollectBus.RedisDataCache; +using JiShe.CollectBus.ScheduledMeterReading; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace JiShe.CollectBus.DataChannels +{ + /// + /// 数据通道管理服务 + /// + public class DataChannelManageService: CollectBusAppService, IDataChannelManageService + { + private readonly ILogger _logger; + private readonly IIoTDbProvider _dbProvider; + private readonly IProducerService _producerService; + private readonly KafkaOptionConfig _kafkaOptions; + private readonly ServerApplicationOptions _applicationOptions; + private readonly IoTDBRuntimeContext _runtimeContext; + + public DataChannelManageService( + ILogger logger, + IIoTDbProvider dbProvider, + IoTDBRuntimeContext runtimeContext, + IProducerService producerService, + IOptions kafkaOptions, + IOptions applicationOptions) + { + _logger = logger; + _dbProvider = dbProvider; + _runtimeContext = runtimeContext; + _producerService = producerService; + _kafkaOptions = kafkaOptions.Value; + _applicationOptions = applicationOptions.Value; + _runtimeContext.UseTableSessionPool = true; + } + } +}