From 274b1a7a833094de05c9dae120a7d066e0d03bd1 Mon Sep 17 00:00:00 2001 From: cli <377476583@qq.com> Date: Wed, 30 Oct 2024 18:01:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ServiceCollectionExtensions.cs | 12 ++---------- ...pServiceReceivedPlugin.cs => TcpServicePlugin.cs} | 6 +++--- ...pServiceReceivedPlugin.cs => UdpServicePlugin.cs} | 2 +- 3 files changed, 6 insertions(+), 14 deletions(-) rename JiShe.CollectBus.Core/Plugins/{TcpServiceReceivedPlugin.cs => TcpServicePlugin.cs} (93%) rename JiShe.CollectBus.Core/Plugins/{UdpServiceReceivedPlugin.cs => UdpServicePlugin.cs} (89%) diff --git a/JiShe.CollectBus.Console/Extensions/ServiceCollections/ServiceCollectionExtensions.cs b/JiShe.CollectBus.Console/Extensions/ServiceCollections/ServiceCollectionExtensions.cs index 98f3eaf..fc6a0fb 100644 --- a/JiShe.CollectBus.Console/Extensions/ServiceCollections/ServiceCollectionExtensions.cs +++ b/JiShe.CollectBus.Console/Extensions/ServiceCollections/ServiceCollectionExtensions.cs @@ -17,14 +17,10 @@ namespace Microsoft.Extensions.DependencyInjection services.AddTcpService(config => { config.SetListenIPHosts(int.Parse(configuration["TCP:ClientPort"] ?? "10500")) - .ConfigureContainer(a => //容器的配置顺序应该在最前面 - { - a.AddConsoleLogger(); - }) .ConfigurePlugins(a => { a.Add(); - a.Add(); + a.Add(); a.Add(); }); }); @@ -40,13 +36,9 @@ namespace Microsoft.Extensions.DependencyInjection services.AddUdpSession(config => { config.SetBindIPHost(int.Parse(configuration["UDP:ClientPort"] ?? "10500")) - .ConfigureContainer(a => //容器的配置顺序应该在最前面 - { - //a.AddConsoleLogger(); - }) .ConfigurePlugins(a => { - a.Add(); + a.Add(); a.Add(); }) .UseBroadcast() diff --git a/JiShe.CollectBus.Core/Plugins/TcpServiceReceivedPlugin.cs b/JiShe.CollectBus.Core/Plugins/TcpServicePlugin.cs similarity index 93% rename from JiShe.CollectBus.Core/Plugins/TcpServiceReceivedPlugin.cs rename to JiShe.CollectBus.Core/Plugins/TcpServicePlugin.cs index ceab344..0b0f1dc 100644 --- a/JiShe.CollectBus.Core/Plugins/TcpServiceReceivedPlugin.cs +++ b/JiShe.CollectBus.Core/Plugins/TcpServicePlugin.cs @@ -9,15 +9,15 @@ using JiShe.CollectBus.MongoDB; namespace JiShe.CollectBus.Core.Plugins { - public partial class TcpServiceReceivedPlugin : PluginBase + public partial class TcpServicePlugin : PluginBase { private readonly INSender _nSender; - private readonly ILogger _logger; + private readonly ILogger _logger; public readonly IMongoRepository _mongoHeartbeatRepository; public readonly IMongoRepository _mongoLoginRepository; - public TcpServiceReceivedPlugin(INSender nSender, ILogger logger,IMongoRepository mongoHeartbeatRepository, IMongoRepository mongoLoginRepository) + public TcpServicePlugin(INSender nSender, ILogger logger,IMongoRepository mongoHeartbeatRepository, IMongoRepository mongoLoginRepository) { _nSender = nSender; _logger = logger; diff --git a/JiShe.CollectBus.Core/Plugins/UdpServiceReceivedPlugin.cs b/JiShe.CollectBus.Core/Plugins/UdpServicePlugin.cs similarity index 89% rename from JiShe.CollectBus.Core/Plugins/UdpServiceReceivedPlugin.cs rename to JiShe.CollectBus.Core/Plugins/UdpServicePlugin.cs index 186cd11..8004d5e 100644 --- a/JiShe.CollectBus.Core/Plugins/UdpServiceReceivedPlugin.cs +++ b/JiShe.CollectBus.Core/Plugins/UdpServicePlugin.cs @@ -4,7 +4,7 @@ using TouchSocket.Sockets; namespace JiShe.CollectBus.Core.Plugins { - public partial class UdpServiceReceivedPlugin : PluginBase + public partial class UdpServicePlugin : PluginBase { [GeneratorPlugin(typeof(IUdpReceivedPlugin))] public async Task OnUdpReceived(IUdpSessionBase client, UdpReceivedDataEventArgs e)