From 6b6c28990ad7ec6d33dc92889d78fb666bba304f Mon Sep 17 00:00:00 2001 From: "SmallChi(Koike)" <564952747@qq.com> Date: Thu, 14 May 2020 10:23:01 +0800 Subject: [PATCH] =?UTF-8?q?v2.3.2=20netty=201.=E4=BF=AE=E5=A4=8D=E6=B6=88?= =?UTF-8?q?=E8=B4=B9=E8=80=85=E4=B8=ADCancellationTokenSource=E6=AF=8F?= =?UTF-8?q?=E6=AC=A1=E8=B0=83=E7=94=A8=E6=97=B6=E9=87=8D=E6=96=B0=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=202.=E4=BF=AE=E5=A4=8D=E6=9C=8D=E5=8A=A1=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E5=90=AF=E5=8A=A8=E6=97=B6=E5=80=99=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E4=BC=98=E9=9B=85=E7=9A=84=E9=87=8A=E6=94=BE=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=98=BE=E7=A4=BA=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98=203.=E4=BF=AE=E5=A4=8D=E5=AE=A2=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E6=96=AD=E5=BC=80=E6=97=B6=EF=BC=8C=E6=B2=A1=E6=9C=89=E5=8F=8A?= =?UTF-8?q?=E6=97=B6=E6=96=AD=E5=BC=80=E8=BF=9E=E6=8E=A5=204.=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0webapi=E9=80=9A=E8=BF=87=E8=AE=BE=E5=A4=87=E7=BB=88?= =?UTF-8?q?=E7=AB=AF=E5=8F=B7=E8=8E=B7=E5=8F=96=E4=BC=9A=E8=AF=9D=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=8E=A5=E5=8F=A3=205.=E5=8D=87=E7=BA=A7808=E5=BA=93?= =?UTF-8?q?=20v1.0.1=20pipeline=201.=E4=BF=AE=E5=A4=8D=E6=B6=88=E8=B4=B9?= =?UTF-8?q?=E8=80=85=E4=B8=ADCancellationTokenSource=E6=AF=8F=E6=AC=A1?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E6=97=B6=E9=87=8D=E6=96=B0=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=202.=E4=BF=AE=E5=A4=8D=E6=9C=8D=E5=8A=A1=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=97=B6=E5=80=99=E6=B2=A1=E6=9C=89=E4=BC=98?= =?UTF-8?q?=E9=9B=85=E7=9A=84=E9=87=8A=E6=94=BE=E5=AF=BC=E8=87=B4=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=98=BE=E7=A4=BA=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= =?UTF-8?q?=203.=E5=8D=87=E7=BA=A7808=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/README.md | 1 + .../JT808.DotNetty.SimpleClient.csproj | 10 +++--- .../JT808.DotNetty.SimpleServer.csproj | 10 +++--- .../JT808.Gateway.SimpleClient.csproj | 12 +++---- ...808.Gateway.SimpleQueueNotification.csproj | 4 +-- .../JT808.Gateway.SimpleQueueServer.csproj | 12 +++---- .../JT808.Gateway.SimpleQueueService.csproj | 24 +++++++------- .../JT808.Gateway.SimpleServer.csproj | 22 ++++++------- .../JT808NettyConstants.cs | 4 +++ .../JT808.DotNetty.CleintBenchmark.csproj | 10 +++--- .../JT808.DotNetty.Client.csproj | 6 ++-- .../Converters/JsonByteArrayHexConverter.cs | 29 +++++++++++++++++ .../Converters/JsonIPAddressConverter.cs | 26 +++++++++++++++ .../Converters/JsonIPEndPointConverter.cs | 32 +++++++++++++++++++ .../Interfaces/IJT808SessionService.cs | 6 ++++ .../JT808.DotNetty.Core.csproj | 1 + .../Services/JT808SessionService.cs | 23 +++++++++++++ .../JT808.DotNetty.Kafka.csproj | 12 +++---- .../JT808.DotNetty.MsgIdHandler.Test.csproj | 6 ++-- .../JT808.DotNetty.MsgLogging.Test.csproj | 6 ++-- .../JT808.DotNetty.ReplyMessage.Test.csproj | 6 ++-- .../JT808.DotNetty.SessionNotice.Test.csproj | 6 ++-- .../JT808.DotNetty.Traffic.Test.csproj | 6 ++-- .../JT808.DotNetty.Transmit.Test.csproj | 6 ++-- .../JT808.DotNetty.MsgIdHandler.csproj | 2 +- .../JT808.DotNetty.MsgLogging.csproj | 6 ++-- .../JT808.DotNetty.ReplyMessage.csproj | 6 ++-- .../JT808.DotNetty.SessionNotice.csproj | 6 ++-- .../JT808.DotNetty.Traffic.csproj | 8 ++--- .../JT808.DotNetty.Transmit.csproj | 8 ++--- .../JT808.DotNetty.Core.Test.csproj | 8 ++--- .../JT808.DotNetty.Hosting.csproj | 14 ++++---- .../JT808.DotNetty.Kafka.Test.csproj | 10 +++--- .../JT808.DotNetty.RabbitMQ.Test.csproj | 2 +- .../JT808.DotNetty.Tcp.Test.csproj | 8 ++--- .../JT808.DotNetty.Udp.Test.csproj | 8 ++--- .../JT808.DotNetty.WebApi.Test.csproj | 4 +-- .../JT808MsgIdDefaultWebApiHandler.cs | 15 +++++++++ .../JT808.DotNetty.WebApiClientTool.csproj | 2 +- src/JT808.DotNetty.sln | 7 ---- .../JT808.Gateway.Abstractions.csproj | 2 +- .../JT808.Gateway.CleintBenchmark.csproj | 10 +++--- .../JT808.Gateway.ServerBenchmark.csproj | 6 ++-- .../JT808.Gateway.Client.csproj | 10 +++--- .../JT808.Gateway.Kafka.csproj | 12 +++---- .../JT808.Gateway.MsgLogging.csproj | 2 +- .../JT808.Gateway.ReplyMessage.csproj | 2 +- .../JT808.Gateway.SessionNotice.csproj | 2 +- .../JT808.Gateway.Transmit.csproj | 2 +- .../JT808.Gateway.NormalHosting.csproj | 6 ++-- .../JT808.Gateway.QueueHosting.csproj | 6 ++-- .../JT808.Gateway.Test.csproj | 6 ++-- src/JT808.Gateway/JT808.Gateway.csproj | 6 ++-- src/Version.props | 4 +-- 54 files changed, 300 insertions(+), 170 deletions(-) create mode 100644 src/JT808.DotNetty.Core/Converters/JsonByteArrayHexConverter.cs create mode 100644 src/JT808.DotNetty.Core/Converters/JsonIPAddressConverter.cs create mode 100644 src/JT808.DotNetty.Core/Converters/JsonIPEndPointConverter.cs diff --git a/api/README.md b/api/README.md index 98cd275..d71c6f8 100644 --- a/api/README.md +++ b/api/README.md @@ -37,6 +37,7 @@ |请求Url|请求方式|说明| |:------|:------|:------| | 127.0.0.1:828/jt808api/Tcp/Session/GetAll| GET| 基于Tcp管理会话服务-获取会话集合| +| 127.0.0.1:828/jt808api/Tcp/Session/QueryTcpSessionByTerminalPhoneNo| POST| 基于Tcp管理会话服务-通过设备终端号查询对应会话| | 127.0.0.1:828/jt808api/Tcp/Session/RemoveByTerminalPhoneNo| POST| 基于Tcp管理会话服务-通过设备终端号移除对应会话| | 127.0.0.1:828/jt808api/Tcp/GetAtomicCounter| GET| 基于Tcp消息包计数服务| diff --git a/simples/JT808.DotNetty.SimpleClient/JT808.DotNetty.SimpleClient.csproj b/simples/JT808.DotNetty.SimpleClient/JT808.DotNetty.SimpleClient.csproj index f548503..96c1695 100644 --- a/simples/JT808.DotNetty.SimpleClient/JT808.DotNetty.SimpleClient.csproj +++ b/simples/JT808.DotNetty.SimpleClient/JT808.DotNetty.SimpleClient.csproj @@ -6,11 +6,11 @@ 7.3 - - - - - + + + + + diff --git a/simples/JT808.DotNetty.SimpleServer/JT808.DotNetty.SimpleServer.csproj b/simples/JT808.DotNetty.SimpleServer/JT808.DotNetty.SimpleServer.csproj index bb6a15e..3707cd4 100644 --- a/simples/JT808.DotNetty.SimpleServer/JT808.DotNetty.SimpleServer.csproj +++ b/simples/JT808.DotNetty.SimpleServer/JT808.DotNetty.SimpleServer.csproj @@ -6,11 +6,11 @@ 7.3 - - - - - + + + + + diff --git a/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj b/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj index 67163d6..3ed6803 100644 --- a/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj +++ b/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj @@ -6,12 +6,12 @@ - - - - - - + + + + + + diff --git a/simples/JT808.Gateway.SimpleQueueNotification/JT808.Gateway.SimpleQueueNotification.csproj b/simples/JT808.Gateway.SimpleQueueNotification/JT808.Gateway.SimpleQueueNotification.csproj index e07bbdf..2c99121 100644 --- a/simples/JT808.Gateway.SimpleQueueNotification/JT808.Gateway.SimpleQueueNotification.csproj +++ b/simples/JT808.Gateway.SimpleQueueNotification/JT808.Gateway.SimpleQueueNotification.csproj @@ -27,7 +27,7 @@ - - + + diff --git a/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj b/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj index c1849b6..472c697 100644 --- a/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj +++ b/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj @@ -6,12 +6,12 @@ - - - - - - + + + + + + diff --git a/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj b/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj index ba7c35d..55dac23 100644 --- a/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj +++ b/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj @@ -6,18 +6,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/simples/JT808.Gateway.SimpleServer/JT808.Gateway.SimpleServer.csproj b/simples/JT808.Gateway.SimpleServer/JT808.Gateway.SimpleServer.csproj index 99a292d..af9aa0f 100644 --- a/simples/JT808.Gateway.SimpleServer/JT808.Gateway.SimpleServer.csproj +++ b/simples/JT808.Gateway.SimpleServer/JT808.Gateway.SimpleServer.csproj @@ -5,17 +5,17 @@ netcoreapp3.1 - - - - - - - - - - - + + + + + + + + + + + diff --git a/src/JT808.DotNetty.Abstractions/JT808NettyConstants.cs b/src/JT808.DotNetty.Abstractions/JT808NettyConstants.cs index 93d1546..500bb70 100644 --- a/src/JT808.DotNetty.Abstractions/JT808NettyConstants.cs +++ b/src/JT808.DotNetty.Abstractions/JT808NettyConstants.cs @@ -32,6 +32,10 @@ /// public static string SessionRemoveByTerminalPhoneNo = $"{RouteTablePrefix}/{SessionPrefix}/RemoveByTerminalPhoneNo"; /// + /// 会话服务-通过设备终端号查询对应会话 + /// + public static string QueryTcpSessionByTerminalPhoneNo = $"{RouteTablePrefix}/{SessionPrefix}/QueryTcpSessionByTerminalPhoneNo"; + /// /// 统一下发信息 /// public static string UnificationSend = $"{RouteTablePrefix}/UnificationSend"; diff --git a/src/JT808.DotNetty.CleintBenchmark/JT808.DotNetty.CleintBenchmark.csproj b/src/JT808.DotNetty.CleintBenchmark/JT808.DotNetty.CleintBenchmark.csproj index d560768..ceeee61 100644 --- a/src/JT808.DotNetty.CleintBenchmark/JT808.DotNetty.CleintBenchmark.csproj +++ b/src/JT808.DotNetty.CleintBenchmark/JT808.DotNetty.CleintBenchmark.csproj @@ -12,11 +12,11 @@ - - - - - + + + + + diff --git a/src/JT808.DotNetty.Client/JT808.DotNetty.Client.csproj b/src/JT808.DotNetty.Client/JT808.DotNetty.Client.csproj index d61caa9..68474d3 100644 --- a/src/JT808.DotNetty.Client/JT808.DotNetty.Client.csproj +++ b/src/JT808.DotNetty.Client/JT808.DotNetty.Client.csproj @@ -25,10 +25,10 @@ - - + + - + diff --git a/src/JT808.DotNetty.Core/Converters/JsonByteArrayHexConverter.cs b/src/JT808.DotNetty.Core/Converters/JsonByteArrayHexConverter.cs new file mode 100644 index 0000000..14875fb --- /dev/null +++ b/src/JT808.DotNetty.Core/Converters/JsonByteArrayHexConverter.cs @@ -0,0 +1,29 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace JT808.DotNetty.Core.Converters +{ + class ByteArrayHexConverter : JsonConverter + { + public override bool CanConvert(Type objectType) => objectType == typeof(byte[]); + + public override bool CanRead => false; + public override bool CanWrite => true; + + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) => throw new NotImplementedException(); + + private readonly string _separator; + + public ByteArrayHexConverter(string separator = " ") => _separator = separator; + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + var hexString = string.Join(_separator, ((byte[])value).Select(p => p.ToString("X2"))); + writer.WriteValue(hexString); + } + } +} diff --git a/src/JT808.DotNetty.Core/Converters/JsonIPAddressConverter.cs b/src/JT808.DotNetty.Core/Converters/JsonIPAddressConverter.cs new file mode 100644 index 0000000..955ed04 --- /dev/null +++ b/src/JT808.DotNetty.Core/Converters/JsonIPAddressConverter.cs @@ -0,0 +1,26 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Net; +using System.Text; + +namespace JT808.DotNetty.Core.Converters +{ + public class JsonIPAddressConverter : JsonConverter + { + public override bool CanConvert(Type objectType) + { + return (objectType == typeof(IPAddress)); + } + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteValue(value.ToString()); + } + + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + return IPAddress.Parse((string)reader.Value); + } + } +} diff --git a/src/JT808.DotNetty.Core/Converters/JsonIPEndPointConverter.cs b/src/JT808.DotNetty.Core/Converters/JsonIPEndPointConverter.cs new file mode 100644 index 0000000..8bed28f --- /dev/null +++ b/src/JT808.DotNetty.Core/Converters/JsonIPEndPointConverter.cs @@ -0,0 +1,32 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System; +using System.Net; + +namespace JT808.DotNetty.Core.Converters +{ + public class JsonIPEndPointConverter: JsonConverter + { + public override bool CanConvert(Type objectType) + { + return (objectType == typeof(IPEndPoint)); + } + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + IPEndPoint ep = (IPEndPoint)value; + JObject jo = new JObject(); + jo.Add("Host", JToken.FromObject(ep.Address, serializer)); + jo.Add("Port", ep.Port); + jo.WriteTo(writer); + } + + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + JObject jo = JObject.Load(reader); + IPAddress address = jo["Host"].ToObject(serializer); + int port = (int)jo["Port"]; + return new IPEndPoint(address, port); + } + } +} diff --git a/src/JT808.DotNetty.Core/Interfaces/IJT808SessionService.cs b/src/JT808.DotNetty.Core/Interfaces/IJT808SessionService.cs index c08c80b..79cd501 100644 --- a/src/JT808.DotNetty.Core/Interfaces/IJT808SessionService.cs +++ b/src/JT808.DotNetty.Core/Interfaces/IJT808SessionService.cs @@ -26,5 +26,11 @@ namespace JT808.DotNetty.Core.Interfaces /// /// JT808ResultDto RemoveByTerminalPhoneNo(string terminalPhoneNo); + /// + /// 通过设备终端号获取对应会话 + /// + /// + /// + JT808ResultDto QueryTcpSessionByTerminalPhoneNo(string terminalPhoneNo); } } diff --git a/src/JT808.DotNetty.Core/JT808.DotNetty.Core.csproj b/src/JT808.DotNetty.Core/JT808.DotNetty.Core.csproj index 1d9157d..ebb21b4 100644 --- a/src/JT808.DotNetty.Core/JT808.DotNetty.Core.csproj +++ b/src/JT808.DotNetty.Core/JT808.DotNetty.Core.csproj @@ -28,6 +28,7 @@ + diff --git a/src/JT808.DotNetty.Core/Services/JT808SessionService.cs b/src/JT808.DotNetty.Core/Services/JT808SessionService.cs index 2a6d62f..f8cb7ba 100644 --- a/src/JT808.DotNetty.Core/Services/JT808SessionService.cs +++ b/src/JT808.DotNetty.Core/Services/JT808SessionService.cs @@ -100,5 +100,28 @@ namespace JT808.DotNetty.Core.Services } return resultDto; } + + public JT808ResultDto QueryTcpSessionByTerminalPhoneNo(string terminalPhoneNo) + { + JT808ResultDto resultDto = new JT808ResultDto(); + try + { + resultDto.Data = jT808SessionManager.GetAll().Where(w=>w.TerminalPhoneNo== terminalPhoneNo).Select(s => new JT808TcpSessionInfoDto + { + LastActiveTime = s.LastActiveTime, + StartTime = s.StartTime, + TerminalPhoneNo = s.TerminalPhoneNo, + RemoteAddressIP = s.Channel.RemoteAddress.ToString(), + }).FirstOrDefault(); + resultDto.Code = JT808ResultCode.Ok; + } + catch (Exception ex) + { + resultDto.Data = null; + resultDto.Code = JT808ResultCode.Error; + resultDto.Message = ex.Message; + } + return resultDto; + } } } diff --git a/src/JT808.DotNetty.Kafka/JT808.DotNetty.Kafka.csproj b/src/JT808.DotNetty.Kafka/JT808.DotNetty.Kafka.csproj index 2e0036b..d279604 100644 --- a/src/JT808.DotNetty.Kafka/JT808.DotNetty.Kafka.csproj +++ b/src/JT808.DotNetty.Kafka/JT808.DotNetty.Kafka.csproj @@ -20,12 +20,12 @@ 基于Kafka的JT808消息发布与订阅 - - - - - - + + + + + + diff --git a/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.MsgIdHandler.Test/JT808.DotNetty.MsgIdHandler.Test.csproj b/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.MsgIdHandler.Test/JT808.DotNetty.MsgIdHandler.Test.csproj index e1fdfc0..ecdf488 100644 --- a/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.MsgIdHandler.Test/JT808.DotNetty.MsgIdHandler.Test.csproj +++ b/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.MsgIdHandler.Test/JT808.DotNetty.MsgIdHandler.Test.csproj @@ -6,9 +6,9 @@ - - - + + + diff --git a/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.MsgLogging.Test/JT808.DotNetty.MsgLogging.Test.csproj b/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.MsgLogging.Test/JT808.DotNetty.MsgLogging.Test.csproj index 7802728..4af3b27 100644 --- a/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.MsgLogging.Test/JT808.DotNetty.MsgLogging.Test.csproj +++ b/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.MsgLogging.Test/JT808.DotNetty.MsgLogging.Test.csproj @@ -6,9 +6,9 @@ - - - + + + diff --git a/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.ReplyMessage.Test/JT808.DotNetty.ReplyMessage.Test.csproj b/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.ReplyMessage.Test/JT808.DotNetty.ReplyMessage.Test.csproj index 5047f55..a23609e 100644 --- a/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.ReplyMessage.Test/JT808.DotNetty.ReplyMessage.Test.csproj +++ b/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.ReplyMessage.Test/JT808.DotNetty.ReplyMessage.Test.csproj @@ -6,9 +6,9 @@ - - - + + + diff --git a/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.SessionNotice.Test/JT808.DotNetty.SessionNotice.Test.csproj b/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.SessionNotice.Test/JT808.DotNetty.SessionNotice.Test.csproj index 4cf435c..0a0bb30 100644 --- a/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.SessionNotice.Test/JT808.DotNetty.SessionNotice.Test.csproj +++ b/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.SessionNotice.Test/JT808.DotNetty.SessionNotice.Test.csproj @@ -6,9 +6,9 @@ - - - + + + diff --git a/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.Traffic.Test/JT808.DotNetty.Traffic.Test.csproj b/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.Traffic.Test/JT808.DotNetty.Traffic.Test.csproj index 600b2aa..b5c5ab6 100644 --- a/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.Traffic.Test/JT808.DotNetty.Traffic.Test.csproj +++ b/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.Traffic.Test/JT808.DotNetty.Traffic.Test.csproj @@ -6,9 +6,9 @@ - - - + + + diff --git a/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.Transmit.Test/JT808.DotNetty.Transmit.Test.csproj b/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.Transmit.Test/JT808.DotNetty.Transmit.Test.csproj index a03d6f1..51a9aaa 100644 --- a/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.Transmit.Test/JT808.DotNetty.Transmit.Test.csproj +++ b/src/JT808.DotNetty.Services.Tests/JT808.DotNetty.Transmit.Test/JT808.DotNetty.Transmit.Test.csproj @@ -6,9 +6,9 @@ - - - + + + diff --git a/src/JT808.DotNetty.Services/JT808.DotNetty.MsgIdHandler/JT808.DotNetty.MsgIdHandler.csproj b/src/JT808.DotNetty.Services/JT808.DotNetty.MsgIdHandler/JT808.DotNetty.MsgIdHandler.csproj index 9bfd24e..6be10f9 100644 --- a/src/JT808.DotNetty.Services/JT808.DotNetty.MsgIdHandler/JT808.DotNetty.MsgIdHandler.csproj +++ b/src/JT808.DotNetty.Services/JT808.DotNetty.MsgIdHandler/JT808.DotNetty.MsgIdHandler.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/JT808.DotNetty.Services/JT808.DotNetty.MsgLogging/JT808.DotNetty.MsgLogging.csproj b/src/JT808.DotNetty.Services/JT808.DotNetty.MsgLogging/JT808.DotNetty.MsgLogging.csproj index cec5e06..52e1754 100644 --- a/src/JT808.DotNetty.Services/JT808.DotNetty.MsgLogging/JT808.DotNetty.MsgLogging.csproj +++ b/src/JT808.DotNetty.Services/JT808.DotNetty.MsgLogging/JT808.DotNetty.MsgLogging.csproj @@ -22,9 +22,9 @@ LICENSE - - - + + + diff --git a/src/JT808.DotNetty.Services/JT808.DotNetty.ReplyMessage/JT808.DotNetty.ReplyMessage.csproj b/src/JT808.DotNetty.Services/JT808.DotNetty.ReplyMessage/JT808.DotNetty.ReplyMessage.csproj index ad53280..17ca90f 100644 --- a/src/JT808.DotNetty.Services/JT808.DotNetty.ReplyMessage/JT808.DotNetty.ReplyMessage.csproj +++ b/src/JT808.DotNetty.Services/JT808.DotNetty.ReplyMessage/JT808.DotNetty.ReplyMessage.csproj @@ -21,9 +21,9 @@ LICENSE - - - + + + diff --git a/src/JT808.DotNetty.Services/JT808.DotNetty.SessionNotice/JT808.DotNetty.SessionNotice.csproj b/src/JT808.DotNetty.Services/JT808.DotNetty.SessionNotice/JT808.DotNetty.SessionNotice.csproj index 332092d..6c2ac0e 100644 --- a/src/JT808.DotNetty.Services/JT808.DotNetty.SessionNotice/JT808.DotNetty.SessionNotice.csproj +++ b/src/JT808.DotNetty.Services/JT808.DotNetty.SessionNotice/JT808.DotNetty.SessionNotice.csproj @@ -22,9 +22,9 @@ LICENSE - - - + + + diff --git a/src/JT808.DotNetty.Services/JT808.DotNetty.Traffic/JT808.DotNetty.Traffic.csproj b/src/JT808.DotNetty.Services/JT808.DotNetty.Traffic/JT808.DotNetty.Traffic.csproj index 6cc05c4..6222a41 100644 --- a/src/JT808.DotNetty.Services/JT808.DotNetty.Traffic/JT808.DotNetty.Traffic.csproj +++ b/src/JT808.DotNetty.Services/JT808.DotNetty.Traffic/JT808.DotNetty.Traffic.csproj @@ -21,10 +21,10 @@ LICENSE - - - - + + + + diff --git a/src/JT808.DotNetty.Services/JT808.DotNetty.Transmit/JT808.DotNetty.Transmit.csproj b/src/JT808.DotNetty.Services/JT808.DotNetty.Transmit/JT808.DotNetty.Transmit.csproj index 9830012..7a4f6bb 100644 --- a/src/JT808.DotNetty.Services/JT808.DotNetty.Transmit/JT808.DotNetty.Transmit.csproj +++ b/src/JT808.DotNetty.Services/JT808.DotNetty.Transmit/JT808.DotNetty.Transmit.csproj @@ -25,10 +25,10 @@ - - - - + + + + diff --git a/src/JT808.DotNetty.Tests/JT808.DotNetty.Core.Test/JT808.DotNetty.Core.Test.csproj b/src/JT808.DotNetty.Tests/JT808.DotNetty.Core.Test/JT808.DotNetty.Core.Test.csproj index 2063141..3537a80 100644 --- a/src/JT808.DotNetty.Tests/JT808.DotNetty.Core.Test/JT808.DotNetty.Core.Test.csproj +++ b/src/JT808.DotNetty.Tests/JT808.DotNetty.Core.Test/JT808.DotNetty.Core.Test.csproj @@ -7,10 +7,10 @@ - - - - + + + + all diff --git a/src/JT808.DotNetty.Tests/JT808.DotNetty.Hosting/JT808.DotNetty.Hosting.csproj b/src/JT808.DotNetty.Tests/JT808.DotNetty.Hosting/JT808.DotNetty.Hosting.csproj index 90037bc..0227e58 100644 --- a/src/JT808.DotNetty.Tests/JT808.DotNetty.Hosting/JT808.DotNetty.Hosting.csproj +++ b/src/JT808.DotNetty.Tests/JT808.DotNetty.Hosting/JT808.DotNetty.Hosting.csproj @@ -8,14 +8,14 @@ - - - - - - + + + + + + - + diff --git a/src/JT808.DotNetty.Tests/JT808.DotNetty.Kafka.Test/JT808.DotNetty.Kafka.Test.csproj b/src/JT808.DotNetty.Tests/JT808.DotNetty.Kafka.Test/JT808.DotNetty.Kafka.Test.csproj index 11996d6..0ba606f 100644 --- a/src/JT808.DotNetty.Tests/JT808.DotNetty.Kafka.Test/JT808.DotNetty.Kafka.Test.csproj +++ b/src/JT808.DotNetty.Tests/JT808.DotNetty.Kafka.Test/JT808.DotNetty.Kafka.Test.csproj @@ -7,11 +7,11 @@ - - - - - + + + + + all diff --git a/src/JT808.DotNetty.Tests/JT808.DotNetty.RabbitMQ.Test/JT808.DotNetty.RabbitMQ.Test.csproj b/src/JT808.DotNetty.Tests/JT808.DotNetty.RabbitMQ.Test/JT808.DotNetty.RabbitMQ.Test.csproj index 653f3eb..acf960f 100644 --- a/src/JT808.DotNetty.Tests/JT808.DotNetty.RabbitMQ.Test/JT808.DotNetty.RabbitMQ.Test.csproj +++ b/src/JT808.DotNetty.Tests/JT808.DotNetty.RabbitMQ.Test/JT808.DotNetty.RabbitMQ.Test.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/JT808.DotNetty.Tests/JT808.DotNetty.Tcp.Test/JT808.DotNetty.Tcp.Test.csproj b/src/JT808.DotNetty.Tests/JT808.DotNetty.Tcp.Test/JT808.DotNetty.Tcp.Test.csproj index 794340f..a86babe 100644 --- a/src/JT808.DotNetty.Tests/JT808.DotNetty.Tcp.Test/JT808.DotNetty.Tcp.Test.csproj +++ b/src/JT808.DotNetty.Tests/JT808.DotNetty.Tcp.Test/JT808.DotNetty.Tcp.Test.csproj @@ -7,10 +7,10 @@ - - - - + + + + all diff --git a/src/JT808.DotNetty.Tests/JT808.DotNetty.Udp.Test/JT808.DotNetty.Udp.Test.csproj b/src/JT808.DotNetty.Tests/JT808.DotNetty.Udp.Test/JT808.DotNetty.Udp.Test.csproj index 6de6e72..aed697a 100644 --- a/src/JT808.DotNetty.Tests/JT808.DotNetty.Udp.Test/JT808.DotNetty.Udp.Test.csproj +++ b/src/JT808.DotNetty.Tests/JT808.DotNetty.Udp.Test/JT808.DotNetty.Udp.Test.csproj @@ -7,10 +7,10 @@ - - - - + + + + all diff --git a/src/JT808.DotNetty.Tests/JT808.DotNetty.WebApi.Test/JT808.DotNetty.WebApi.Test.csproj b/src/JT808.DotNetty.Tests/JT808.DotNetty.WebApi.Test/JT808.DotNetty.WebApi.Test.csproj index c505c39..b967153 100644 --- a/src/JT808.DotNetty.Tests/JT808.DotNetty.WebApi.Test/JT808.DotNetty.WebApi.Test.csproj +++ b/src/JT808.DotNetty.Tests/JT808.DotNetty.WebApi.Test/JT808.DotNetty.WebApi.Test.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/src/JT808.DotNetty.WebApi/Handlers/JT808MsgIdDefaultWebApiHandler.cs b/src/JT808.DotNetty.WebApi/Handlers/JT808MsgIdDefaultWebApiHandler.cs index 1ac0ed5..93a7426 100644 --- a/src/JT808.DotNetty.WebApi/Handlers/JT808MsgIdDefaultWebApiHandler.cs +++ b/src/JT808.DotNetty.WebApi/Handlers/JT808MsgIdDefaultWebApiHandler.cs @@ -49,6 +49,20 @@ namespace JT808.DotNetty.WebApi.Handlers return CreateJT808HttpResponse(result); } + /// + /// 通过终端手机号查询对应会话 + /// + /// + /// + public JT808HttpResponse QueryTcpSessionByTerminalPhoneNo(JT808HttpRequest request) + { + if (string.IsNullOrEmpty(request.Json)) + { + return EmptyHttpResponse(); + } + return CreateJT808HttpResponse(jT808SessionService.GetTcpAll()); + } + /// /// 会话服务-通过设备终端号移除对应会话 /// @@ -130,6 +144,7 @@ namespace JT808.DotNetty.WebApi.Handlers { CreateRoute(JT808NettyConstants.JT808WebApiRouteTable.UnificationSend, UnificationSend); CreateRoute(JT808NettyConstants.JT808WebApiRouteTable.SessionRemoveByTerminalPhoneNo, RemoveSessionByTerminalPhoneNo); + CreateRoute(JT808NettyConstants.JT808WebApiRouteTable.QueryTcpSessionByTerminalPhoneNo, QueryTcpSessionByTerminalPhoneNo); } protected virtual void InitTcpRoute() diff --git a/src/JT808.DotNetty.WebApiClientTool/JT808.DotNetty.WebApiClientTool.csproj b/src/JT808.DotNetty.WebApiClientTool/JT808.DotNetty.WebApiClientTool.csproj index 63a603b..82bf285 100644 --- a/src/JT808.DotNetty.WebApiClientTool/JT808.DotNetty.WebApiClientTool.csproj +++ b/src/JT808.DotNetty.WebApiClientTool/JT808.DotNetty.WebApiClientTool.csproj @@ -24,7 +24,7 @@ - + diff --git a/src/JT808.DotNetty.sln b/src/JT808.DotNetty.sln index a2356de..f8bdb21 100644 --- a/src/JT808.DotNetty.sln +++ b/src/JT808.DotNetty.sln @@ -33,8 +33,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT808.DotNetty.Kafka", "JT8 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT808.DotNetty.Kafka.Test", "JT808.DotNetty.Tests\JT808.DotNetty.Kafka.Test\JT808.DotNetty.Kafka.Test.csproj", "{50A94BD5-5CDF-4777-AE4C-80BA769AEDAB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT808.DotNetty.RabbitMQ.Test", "JT808.DotNetty.Tests\JT808.DotNetty.RabbitMQ.Test\JT808.DotNetty.RabbitMQ.Test.csproj", "{D3CA0D73-1CCF-41BA-88D8-5BE50515CA64}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{7F077BD5-8E4C-402A-9E24-DECAF251A420}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT808.DotNetty.Transmit", "JT808.DotNetty.Services\JT808.DotNetty.Transmit\JT808.DotNetty.Transmit.csproj", "{0E2326F8-4C96-446B-9B91-285635870171}" @@ -125,10 +123,6 @@ Global {50A94BD5-5CDF-4777-AE4C-80BA769AEDAB}.Debug|Any CPU.Build.0 = Debug|Any CPU {50A94BD5-5CDF-4777-AE4C-80BA769AEDAB}.Release|Any CPU.ActiveCfg = Release|Any CPU {50A94BD5-5CDF-4777-AE4C-80BA769AEDAB}.Release|Any CPU.Build.0 = Release|Any CPU - {D3CA0D73-1CCF-41BA-88D8-5BE50515CA64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D3CA0D73-1CCF-41BA-88D8-5BE50515CA64}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D3CA0D73-1CCF-41BA-88D8-5BE50515CA64}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D3CA0D73-1CCF-41BA-88D8-5BE50515CA64}.Release|Any CPU.Build.0 = Release|Any CPU {0E2326F8-4C96-446B-9B91-285635870171}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0E2326F8-4C96-446B-9B91-285635870171}.Debug|Any CPU.Build.0 = Debug|Any CPU {0E2326F8-4C96-446B-9B91-285635870171}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -191,7 +185,6 @@ Global {E503BFD8-D90A-4610-97C7-5B9A0497303B} = {3BD7FF02-8516-4A77-A385-9FDCDD792E22} {A0F2F006-5AEB-454E-83C5-ABFB58DE17A9} = {3BD7FF02-8516-4A77-A385-9FDCDD792E22} {50A94BD5-5CDF-4777-AE4C-80BA769AEDAB} = {3BD7FF02-8516-4A77-A385-9FDCDD792E22} - {D3CA0D73-1CCF-41BA-88D8-5BE50515CA64} = {3BD7FF02-8516-4A77-A385-9FDCDD792E22} {0E2326F8-4C96-446B-9B91-285635870171} = {7F077BD5-8E4C-402A-9E24-DECAF251A420} {4C01B160-543B-4659-B99C-B9C774B3DEE9} = {7F077BD5-8E4C-402A-9E24-DECAF251A420} {24E3A6DD-0BC4-4EDA-AC40-B07371BB5FDB} = {7F077BD5-8E4C-402A-9E24-DECAF251A420} diff --git a/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj b/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj index b5747f4..5fbd11f 100644 --- a/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj +++ b/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj @@ -36,7 +36,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + 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 953e77b..b069c13 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 @@ -12,11 +12,11 @@ - - - - - + + + + + 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 184c555..62f3fc3 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 @@ -6,10 +6,10 @@ - - + + - + diff --git a/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj b/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj index a0b9abb..95de2ec 100644 --- a/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj +++ b/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj @@ -23,11 +23,11 @@ - - - - - + + + + + diff --git a/src/JT808.Gateway.Kafka/JT808.Gateway.Kafka.csproj b/src/JT808.Gateway.Kafka/JT808.Gateway.Kafka.csproj index bad5ee3..acc5861 100644 --- a/src/JT808.Gateway.Kafka/JT808.Gateway.Kafka.csproj +++ b/src/JT808.Gateway.Kafka/JT808.Gateway.Kafka.csproj @@ -20,12 +20,12 @@ $(JT808GatewayPackageVersion) - - - - - - + + + + + + diff --git a/src/JT808.Gateway.Services/JT808.Gateway.MsgLogging/JT808.Gateway.MsgLogging.csproj b/src/JT808.Gateway.Services/JT808.Gateway.MsgLogging/JT808.Gateway.MsgLogging.csproj index 3ed4582..6651c8f 100644 --- a/src/JT808.Gateway.Services/JT808.Gateway.MsgLogging/JT808.Gateway.MsgLogging.csproj +++ b/src/JT808.Gateway.Services/JT808.Gateway.MsgLogging/JT808.Gateway.MsgLogging.csproj @@ -22,7 +22,7 @@ LICENSE - + diff --git a/src/JT808.Gateway.Services/JT808.Gateway.ReplyMessage/JT808.Gateway.ReplyMessage.csproj b/src/JT808.Gateway.Services/JT808.Gateway.ReplyMessage/JT808.Gateway.ReplyMessage.csproj index 2997850..70d1057 100644 --- a/src/JT808.Gateway.Services/JT808.Gateway.ReplyMessage/JT808.Gateway.ReplyMessage.csproj +++ b/src/JT808.Gateway.Services/JT808.Gateway.ReplyMessage/JT808.Gateway.ReplyMessage.csproj @@ -21,7 +21,7 @@ LICENSE - + diff --git a/src/JT808.Gateway.Services/JT808.Gateway.SessionNotice/JT808.Gateway.SessionNotice.csproj b/src/JT808.Gateway.Services/JT808.Gateway.SessionNotice/JT808.Gateway.SessionNotice.csproj index bfe4066..5e17e0b 100644 --- a/src/JT808.Gateway.Services/JT808.Gateway.SessionNotice/JT808.Gateway.SessionNotice.csproj +++ b/src/JT808.Gateway.Services/JT808.Gateway.SessionNotice/JT808.Gateway.SessionNotice.csproj @@ -22,7 +22,7 @@ LICENSE - + diff --git a/src/JT808.Gateway.Services/JT808.Gateway.Transmit/JT808.Gateway.Transmit.csproj b/src/JT808.Gateway.Services/JT808.Gateway.Transmit/JT808.Gateway.Transmit.csproj index e8334de..29e5037 100644 --- a/src/JT808.Gateway.Services/JT808.Gateway.Transmit/JT808.Gateway.Transmit.csproj +++ b/src/JT808.Gateway.Services/JT808.Gateway.Transmit/JT808.Gateway.Transmit.csproj @@ -22,7 +22,7 @@ LICENSE - + 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 714c20d..2c53225 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 @@ -7,10 +7,10 @@ - - + + - + 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 73cec5e..96ec2ee 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 @@ -6,10 +6,10 @@ - - + + - + 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 6f7658a..ca5e220 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 @@ -7,9 +7,9 @@ - - - + + + all diff --git a/src/JT808.Gateway/JT808.Gateway.csproj b/src/JT808.Gateway/JT808.Gateway.csproj index d3b4e08..6ec6dd1 100644 --- a/src/JT808.Gateway/JT808.Gateway.csproj +++ b/src/JT808.Gateway/JT808.Gateway.csproj @@ -21,9 +21,9 @@ - - - + + + diff --git a/src/Version.props b/src/Version.props index 42dd09c..de259bb 100644 --- a/src/Version.props +++ b/src/Version.props @@ -1,6 +1,6 @@  - 2.3.1 - 1.0.0 + 2.3.2 + 1.0.1 \ No newline at end of file