From 5e19ace5a04c2fb5f7081e491202d725ebff2f8b Mon Sep 17 00:00:00 2001 From: "smallchi(Koike)" <564952747@qq.com> Date: Wed, 7 Jun 2023 19:05:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JT808.Gateway.NBIotSimpleClient.csproj | 4 ++-- .../JT808.Gateway.SimpleClient.csproj | 2 +- .../JT808.Gateway.SimpleQueueServer.csproj | 2 +- .../JT808.Gateway.SimpleQueueService.csproj | 2 +- .../IJT808ClientBuilder.cs | 5 ++--- .../IJT808GatewayBuilder.cs | 5 ++--- .../JT808.Gateway.Abstractions.csproj | 3 +-- .../JT808.Gateway.CleintBenchmark.csproj | 2 +- .../JT808.Gateway.ServerBenchmark.csproj | 2 +- .../IJT808ClientBuilder.cs | 5 ++--- .../Internal/JT808ClientBuilderDefault.cs | 7 +++---- .../JT808.Gateway.Client.csproj | 3 +-- .../JT808ClientExtensions.cs | 3 +-- .../JT808.Gateway.Kafka.csproj | 2 +- .../JT808ClientBuilderDefault.cs | 7 +++---- .../JT808ClientKafkaExtensions.cs | 3 +-- .../JT808.Gateway.NormalHosting.csproj | 2 +- .../JT808.Gateway.QueueHosting.csproj | 2 +- .../JT808.Gateway.Test.csproj | 4 ++-- .../Session/JT808SessionManagerTest.cs | 18 +++++++++--------- .../JT808.Gateway.WebApiClientTool.xml | 8 ++++---- .../JT808HttpClientExtensions.cs | 9 ++++----- .../Internal/JT808GatewayBuilderDefault.cs | 7 +++---- src/JT808.Gateway/JT808.Gateway.xml | 4 ++-- src/JT808.Gateway/JT808GatewayExtensions.cs | 5 ++--- src/PipelineInfo.props | 2 +- 26 files changed, 53 insertions(+), 65 deletions(-) diff --git a/simples/JT808.Gateway.NBIotSimpleClient/JT808.Gateway.NBIotSimpleClient.csproj b/simples/JT808.Gateway.NBIotSimpleClient/JT808.Gateway.NBIotSimpleClient.csproj index 3df6273..5cd67c4 100644 --- a/simples/JT808.Gateway.NBIotSimpleClient/JT808.Gateway.NBIotSimpleClient.csproj +++ b/simples/JT808.Gateway.NBIotSimpleClient/JT808.Gateway.NBIotSimpleClient.csproj @@ -5,10 +5,10 @@ net7.0 - + - + diff --git a/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj b/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj index 3b3300e..097300f 100644 --- a/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj +++ b/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj @@ -8,7 +8,7 @@ - + diff --git a/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj b/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj index 9dea51c..b0758b4 100644 --- a/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj +++ b/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj @@ -8,7 +8,7 @@ - + diff --git a/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj b/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj index 2d853d0..fc0b988 100644 --- a/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj +++ b/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/JT808.Gateway.Abstractions/IJT808ClientBuilder.cs b/src/JT808.Gateway.Abstractions/IJT808ClientBuilder.cs index 0b76634..9574094 100644 --- a/src/JT808.Gateway.Abstractions/IJT808ClientBuilder.cs +++ b/src/JT808.Gateway.Abstractions/IJT808ClientBuilder.cs @@ -1,5 +1,4 @@ using JT808.Protocol; -using JT808.Protocol.DependencyInjection; using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; @@ -9,7 +8,7 @@ namespace JT808.Gateway.Abstractions { public interface IJT808ClientBuilder { - IJT808DIBuilder JT808Builder { get; } - IJT808DIBuilder Builder(); + IJT808Builder JT808Builder { get; } + IJT808Builder Builder(); } } diff --git a/src/JT808.Gateway.Abstractions/IJT808GatewayBuilder.cs b/src/JT808.Gateway.Abstractions/IJT808GatewayBuilder.cs index 3c92991..72f6bbd 100644 --- a/src/JT808.Gateway.Abstractions/IJT808GatewayBuilder.cs +++ b/src/JT808.Gateway.Abstractions/IJT808GatewayBuilder.cs @@ -1,5 +1,4 @@ using JT808.Protocol; -using JT808.Protocol.DependencyInjection; using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; @@ -9,7 +8,7 @@ namespace JT808.Gateway.Abstractions { public interface IJT808GatewayBuilder { - IJT808DIBuilder JT808Builder { get; } - IJT808DIBuilder Builder(); + IJT808Builder JT808Builder { get; } + IJT808Builder Builder(); } } diff --git a/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj b/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj index ec2acfd..d01e6f9 100644 --- a/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj +++ b/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj @@ -16,8 +16,7 @@ - - + diff --git a/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/JT808.Gateway.CleintBenchmark.csproj b/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/JT808.Gateway.CleintBenchmark.csproj index e6b6ec0..57a8e45 100644 --- a/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/JT808.Gateway.CleintBenchmark.csproj +++ b/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/JT808.Gateway.CleintBenchmark.csproj @@ -20,7 +20,7 @@ - + diff --git a/src/JT808.Gateway.Benchmark/JT808.Gateway.ServerBenchmark/JT808.Gateway.ServerBenchmark.csproj b/src/JT808.Gateway.Benchmark/JT808.Gateway.ServerBenchmark/JT808.Gateway.ServerBenchmark.csproj index add755b..e0e5966 100644 --- a/src/JT808.Gateway.Benchmark/JT808.Gateway.ServerBenchmark/JT808.Gateway.ServerBenchmark.csproj +++ b/src/JT808.Gateway.Benchmark/JT808.Gateway.ServerBenchmark/JT808.Gateway.ServerBenchmark.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/JT808.Gateway.Client/IJT808ClientBuilder.cs b/src/JT808.Gateway.Client/IJT808ClientBuilder.cs index a2ddf13..319a361 100644 --- a/src/JT808.Gateway.Client/IJT808ClientBuilder.cs +++ b/src/JT808.Gateway.Client/IJT808ClientBuilder.cs @@ -1,5 +1,4 @@ using JT808.Protocol; -using JT808.Protocol.DependencyInjection; using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; @@ -9,7 +8,7 @@ namespace JT808.Gateway.Client { public interface IJT808ClientBuilder { - IJT808DIBuilder JT808Builder { get; } - IJT808DIBuilder Builder(); + IJT808Builder JT808Builder { get; } + IJT808Builder Builder(); } } diff --git a/src/JT808.Gateway.Client/Internal/JT808ClientBuilderDefault.cs b/src/JT808.Gateway.Client/Internal/JT808ClientBuilderDefault.cs index 4fefdbc..54b26d0 100644 --- a/src/JT808.Gateway.Client/Internal/JT808ClientBuilderDefault.cs +++ b/src/JT808.Gateway.Client/Internal/JT808ClientBuilderDefault.cs @@ -1,5 +1,4 @@ using JT808.Protocol; -using JT808.Protocol.DependencyInjection; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using System; @@ -10,14 +9,14 @@ namespace JT808.Gateway.Client { internal class JT808ClientBuilderDefault : IJT808ClientBuilder { - public IJT808DIBuilder JT808Builder { get; } + public IJT808Builder JT808Builder { get; } - public JT808ClientBuilderDefault(IJT808DIBuilder builder) + public JT808ClientBuilderDefault(IJT808Builder builder) { JT808Builder = builder; } - public IJT808DIBuilder Builder() + public IJT808Builder Builder() { return JT808Builder; } diff --git a/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj b/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj index 24ae0e6..b77e32c 100644 --- a/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj +++ b/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj @@ -10,8 +10,7 @@ - - + diff --git a/src/JT808.Gateway.Client/JT808ClientExtensions.cs b/src/JT808.Gateway.Client/JT808ClientExtensions.cs index 614300f..4fbecb3 100644 --- a/src/JT808.Gateway.Client/JT808ClientExtensions.cs +++ b/src/JT808.Gateway.Client/JT808ClientExtensions.cs @@ -7,13 +7,12 @@ using JT808.Gateway.Client.Services; using Microsoft.Extensions.DependencyInjection.Extensions; using JT808.Gateway.Client.Internal; -using JT808.Protocol.DependencyInjection; namespace JT808.Gateway.Client { public static class JT808ClientExtensions { - public static IJT808ClientBuilder AddClient(this IJT808DIBuilder jT808Builder) + public static IJT808ClientBuilder AddClient(this IJT808Builder jT808Builder) { JT808ClientBuilderDefault jT808ClientBuilderDefault = new JT808ClientBuilderDefault(jT808Builder); jT808ClientBuilderDefault.JT808Builder.Services.AddSingleton(); diff --git a/src/JT808.Gateway.Kafka/JT808.Gateway.Kafka.csproj b/src/JT808.Gateway.Kafka/JT808.Gateway.Kafka.csproj index 8616aa3..9f9695c 100644 --- a/src/JT808.Gateway.Kafka/JT808.Gateway.Kafka.csproj +++ b/src/JT808.Gateway.Kafka/JT808.Gateway.Kafka.csproj @@ -8,7 +8,7 @@ JT808.Gateway.Kafka.xml - + diff --git a/src/JT808.Gateway.Kafka/JT808ClientBuilderDefault.cs b/src/JT808.Gateway.Kafka/JT808ClientBuilderDefault.cs index f929d1b..d34e239 100644 --- a/src/JT808.Gateway.Kafka/JT808ClientBuilderDefault.cs +++ b/src/JT808.Gateway.Kafka/JT808ClientBuilderDefault.cs @@ -1,6 +1,5 @@ using JT808.Gateway.Abstractions; using JT808.Protocol; -using JT808.Protocol.DependencyInjection; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using System; @@ -11,14 +10,14 @@ namespace JT808.Gateway.Kafka { internal class JT808ClientBuilderDefault : IJT808ClientBuilder { - public IJT808DIBuilder JT808Builder { get; } + public IJT808Builder JT808Builder { get; } - public JT808ClientBuilderDefault(IJT808DIBuilder builder) + public JT808ClientBuilderDefault(IJT808Builder builder) { JT808Builder = builder; } - public IJT808DIBuilder Builder() + public IJT808Builder Builder() { return JT808Builder; } diff --git a/src/JT808.Gateway.Kafka/JT808ClientKafkaExtensions.cs b/src/JT808.Gateway.Kafka/JT808ClientKafkaExtensions.cs index 505a072..412bb6f 100644 --- a/src/JT808.Gateway.Kafka/JT808ClientKafkaExtensions.cs +++ b/src/JT808.Gateway.Kafka/JT808ClientKafkaExtensions.cs @@ -5,13 +5,12 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; -using JT808.Protocol.DependencyInjection; namespace JT808.Gateway.Kafka { public static class JT808ClientKafkaExtensions { - public static IJT808ClientBuilder AddClientKafka(this IJT808DIBuilder builder) + public static IJT808ClientBuilder AddClientKafka(this IJT808Builder builder) { return new JT808ClientBuilderDefault(builder); } diff --git a/src/JT808.Gateway.Tests/JT808.Gateway.NormalHosting/JT808.Gateway.NormalHosting.csproj b/src/JT808.Gateway.Tests/JT808.Gateway.NormalHosting/JT808.Gateway.NormalHosting.csproj index b93680b..20c43f9 100644 --- a/src/JT808.Gateway.Tests/JT808.Gateway.NormalHosting/JT808.Gateway.NormalHosting.csproj +++ b/src/JT808.Gateway.Tests/JT808.Gateway.NormalHosting/JT808.Gateway.NormalHosting.csproj @@ -26,7 +26,7 @@ - + diff --git a/src/JT808.Gateway.Tests/JT808.Gateway.QueueHosting/JT808.Gateway.QueueHosting.csproj b/src/JT808.Gateway.Tests/JT808.Gateway.QueueHosting/JT808.Gateway.QueueHosting.csproj index 7a82e04..b4854cc 100644 --- a/src/JT808.Gateway.Tests/JT808.Gateway.QueueHosting/JT808.Gateway.QueueHosting.csproj +++ b/src/JT808.Gateway.Tests/JT808.Gateway.QueueHosting/JT808.Gateway.QueueHosting.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/JT808.Gateway.Tests/JT808.Gateway.Test/JT808.Gateway.Test.csproj b/src/JT808.Gateway.Tests/JT808.Gateway.Test/JT808.Gateway.Test.csproj index c24921d..a514bf7 100644 --- a/src/JT808.Gateway.Tests/JT808.Gateway.Test/JT808.Gateway.Test.csproj +++ b/src/JT808.Gateway.Tests/JT808.Gateway.Test/JT808.Gateway.Test.csproj @@ -9,13 +9,13 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/JT808.Gateway.Tests/JT808.Gateway.Test/Session/JT808SessionManagerTest.cs b/src/JT808.Gateway.Tests/JT808.Gateway.Test/Session/JT808SessionManagerTest.cs index 4c11724..034efe5 100644 --- a/src/JT808.Gateway.Tests/JT808.Gateway.Test/Session/JT808SessionManagerTest.cs +++ b/src/JT808.Gateway.Tests/JT808.Gateway.Test/Session/JT808SessionManagerTest.cs @@ -39,15 +39,15 @@ public void TryLinkTest() public void PerfSession1M() { //Random.Shared.Next(0,1000000) - int number = 1000000; - JT808SessionManager jT808SessionManager = new JT808SessionManager(new LoggerFactory()); - Parallel.For(0, number, (i) => - { - string tno = i.ToString(); - var session = new JT808TcpSession(new Socket(SocketType.Stream, ProtocolType.Tcp)); - var result1 = jT808SessionManager.TryAdd(session); - jT808SessionManager.TryLink(tno, session); - }); + //int number = 1000000; + //JT808SessionManager jT808SessionManager = new JT808SessionManager(new LoggerFactory()); + //Parallel.For(0, number, (i) => + //{ + // string tno = i.ToString(); + // var session = new JT808TcpSession(new Socket(SocketType.Stream, ProtocolType.Tcp)); + // var result1 = jT808SessionManager.TryAdd(session); + // jT808SessionManager.TryLink(tno, session); + //}); } /// diff --git a/src/JT808.Gateway.WebApiClientTool/JT808.Gateway.WebApiClientTool.xml b/src/JT808.Gateway.WebApiClientTool/JT808.Gateway.WebApiClientTool.xml index 912463c..3240afa 100644 --- a/src/JT808.Gateway.WebApiClientTool/JT808.Gateway.WebApiClientTool.xml +++ b/src/JT808.Gateway.WebApiClientTool/JT808.Gateway.WebApiClientTool.xml @@ -121,7 +121,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -163,7 +163,7 @@ - + diff --git a/src/JT808.Gateway.WebApiClientTool/JT808HttpClientExtensions.cs b/src/JT808.Gateway.WebApiClientTool/JT808HttpClientExtensions.cs index 19ed5d4..c07ff70 100644 --- a/src/JT808.Gateway.WebApiClientTool/JT808HttpClientExtensions.cs +++ b/src/JT808.Gateway.WebApiClientTool/JT808HttpClientExtensions.cs @@ -1,6 +1,5 @@ using JT808.Gateway.Abstractions; using JT808.Protocol; -using JT808.Protocol.DependencyInjection; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using System; @@ -61,7 +60,7 @@ public static IServiceCollection AddJT808WebApiClientTool(this IServiceCollectio /// /// /// - public static IJT808DIBuilder AddWebApiClientTool(this IJT808DIBuilder jT808Builder, IConfiguration configuration) + public static IJT808Builder AddWebApiClientTool(this IJT808Builder jT808Builder, IConfiguration configuration) { jT808Builder.Services.AddHttpClient("JT808WebApiClientTool", c => { @@ -81,7 +80,7 @@ public static IJT808DIBuilder AddWebApiClientTool(this IJT808DIBuilder jT808Buil /// /// /// - public static IJT808DIBuilder AddWebApiClientTool(this IJT808DIBuilder jT808Builder, Uri webapiUri, string token) + public static IJT808Builder AddWebApiClientTool(this IJT808Builder jT808Builder, Uri webapiUri, string token) { jT808Builder.Services.AddHttpClient("JT808WebApiClientTool", c => { @@ -141,7 +140,7 @@ public static IServiceCollection AddJT808WebApiClientTool(this /// /// /// - public static IJT808DIBuilder AddWebApiClientTool(this IJT808DIBuilder jT808Builder, IConfiguration configuration) + public static IJT808Builder AddWebApiClientTool(this IJT808Builder jT808Builder, IConfiguration configuration) where TJT808HttpClient : JT808HttpClient { jT808Builder.Services.AddHttpClient("JT808WebApiClientToolExt", c => @@ -162,7 +161,7 @@ public static IJT808DIBuilder AddWebApiClientTool(this IJT808D /// /// /// - public static IJT808DIBuilder AddWebApiClientTool(this IJT808DIBuilder jT808Builder, Uri webapiUri, string token) + public static IJT808Builder AddWebApiClientTool(this IJT808Builder jT808Builder, Uri webapiUri, string token) where TJT808HttpClient: JT808HttpClient { jT808Builder.Services.AddHttpClient("JT808WebApiClientToolExt", c => diff --git a/src/JT808.Gateway/Internal/JT808GatewayBuilderDefault.cs b/src/JT808.Gateway/Internal/JT808GatewayBuilderDefault.cs index 76723e9..1ef7110 100644 --- a/src/JT808.Gateway/Internal/JT808GatewayBuilderDefault.cs +++ b/src/JT808.Gateway/Internal/JT808GatewayBuilderDefault.cs @@ -1,19 +1,18 @@ using JT808.Gateway.Abstractions; using JT808.Protocol; -using JT808.Protocol.DependencyInjection; namespace JT808.Gateway.Internal { public class JT808GatewayBuilderDefault : IJT808GatewayBuilder { - public IJT808DIBuilder JT808Builder { get; } + public IJT808Builder JT808Builder { get; } - public JT808GatewayBuilderDefault(IJT808DIBuilder builder) + public JT808GatewayBuilderDefault(IJT808Builder builder) { JT808Builder = builder; } - public IJT808DIBuilder Builder() + public IJT808Builder Builder() { return JT808Builder; } diff --git a/src/JT808.Gateway/JT808.Gateway.xml b/src/JT808.Gateway/JT808.Gateway.xml index 94fe8e0..a0ea9e6 100644 --- a/src/JT808.Gateway/JT808.Gateway.xml +++ b/src/JT808.Gateway/JT808.Gateway.xml @@ -92,7 +92,7 @@ JT808网关注册扩展 - + 添加808网关 @@ -100,7 +100,7 @@ - + 添加808网关 diff --git a/src/JT808.Gateway/JT808GatewayExtensions.cs b/src/JT808.Gateway/JT808GatewayExtensions.cs index 780b26c..c685871 100644 --- a/src/JT808.Gateway/JT808GatewayExtensions.cs +++ b/src/JT808.Gateway/JT808GatewayExtensions.cs @@ -11,7 +11,6 @@ using System; using System.Runtime.CompilerServices; using System.Linq; -using JT808.Protocol.DependencyInjection; [assembly: InternalsVisibleTo("JT808.Gateway.TestHosting")] [assembly: InternalsVisibleTo("JT808.Gateway.Test")] @@ -28,7 +27,7 @@ public static partial class JT808GatewayExtensions /// /// /// - public static IJT808GatewayBuilder AddGateway(this IJT808DIBuilder jT808Builder, Action config) + public static IJT808GatewayBuilder AddGateway(this IJT808Builder jT808Builder, Action config) { JT808GatewayBuilderDefault jT808GatewayBuilderDefault = new JT808GatewayBuilderDefault(jT808Builder); jT808GatewayBuilderDefault.JT808Builder.Services.Configure(config); @@ -41,7 +40,7 @@ public static IJT808GatewayBuilder AddGateway(this IJT808DIBuilder jT808Builder, /// /// /// - public static IJT808GatewayBuilder AddGateway(this IJT808DIBuilder jT808Builder, IConfiguration configuration) + public static IJT808GatewayBuilder AddGateway(this IJT808Builder jT808Builder, IConfiguration configuration) { JT808GatewayBuilderDefault jT808GatewayBuilderDefault = new JT808GatewayBuilderDefault(jT808Builder); jT808GatewayBuilderDefault.JT808Builder.Services.Configure(configuration.GetSection("JT808Configuration")); diff --git a/src/PipelineInfo.props b/src/PipelineInfo.props index 66c048d..b6563bb 100644 --- a/src/PipelineInfo.props +++ b/src/PipelineInfo.props @@ -8,7 +8,7 @@ https://github.com/SmallChi/JT808Gateway https://github.com/SmallChi/JT808Gateway/blob/master/LICENSE https://github.com/SmallChi/JT808Gateway/blob/master/LICENSE - 1.1.8-preview5 + 1.1.8-preview6 LICENSE true latest