lith 5 년 전
부모
커밋
d7406a0034
31개의 변경된 파일170개의 추가작업 그리고 121개의 파일을 삭제
  1. 1 1
      dotnet/Sers/ApiLoader/Sers.NetcoreLoader/Sers.NetcoreLoader.csproj
  2. 1 1
      dotnet/Sers/ApiLoader/Sers.Serslot/Sers.Serslot.csproj
  3. 1 1
      dotnet/Sers/Sers.CL/Ipc/Sers.CL.Ipc.SharedMemory/Sers.CL.Ipc.SharedMemory.csproj
  4. 1 1
      dotnet/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Sers.CL.Socket.Iocp.csproj
  5. 1 1
      dotnet/Sers/Sers.CL/Socket/Sers.CL.Socket.ThreadWait/Sers.CL.Socket.ThreadWait.csproj
  6. 1 1
      dotnet/Sers/Sers.CL/WebSocket/Sers.CL.WebSocket/Sers.CL.WebSocket.csproj
  7. 1 1
      dotnet/Sers/Sers.CL/Zmq/FullDuplex/Sers.CL.Zmq.FullDuplex/Sers.CL.Zmq.FullDuplex.csproj
  8. 1 1
      dotnet/Sers/Sers.CL/Zmq/ThreadWait/Sers.CL.ClrZmq.ThreadWait/Sers.CL.ClrZmq.ThreadWait.csproj
  9. 65 29
      dotnet/Sers/Sers.Core/Sers.Core/Module/Api/ApiClient.cs
  10. 31 0
      dotnet/Sers/Sers.Core/Sers.Core/Module/Api/Rpc/Extendsions/IRpcContextDataExtensions.cs
  11. 29 45
      dotnet/Sers/Sers.Core/Sers.Core/Module/Message/Extendsions/ApiMessageExtensions.cs
  12. 1 1
      dotnet/Sers/Sers.Core/Sers.Core/Sers.Core.csproj
  13. 1 1
      dotnet/Sers/Sers.Gateway/Sers.Gateway/Sers.Gateway.csproj
  14. 1 1
      dotnet/Sers/Sers.Hardware/Sers.Hardware/Sers.Hardware.csproj
  15. 1 1
      dotnet/Sers/Sers.Ioc/Sers.Ioc/Sers.Ioc.csproj
  16. 1 1
      dotnet/Sers/Sers.ServiceCenter/Sers.Gover/Sers.Gover.csproj
  17. 1 1
      dotnet/Sers/Sers.ServiceCenter/Sers.ServiceCenter/Sers.ServiceCenter.csproj
  18. 1 1
      dotnet/Sers/Sers.ServiceStation/Sers.ServiceStation/Sers.ServiceStation.csproj
  19. 1 1
      dotnet/StationDemo/SersLoader/Did.SersLoader.Demo/Did.SersLoader.Demo.csproj
  20. 1 1
      dotnet/StationDemo/SersLoader/Did.SersLoader.HelloWorld/Did.SersLoader.HelloWorld.csproj
  21. 1 1
      dotnet/Vit/Vit.Core/Vit.Core/Module/Serialization/Serialization.cs
  22. 18 20
      dotnet/Vit/Vit.Core/Vit.Core/Util/Net/HttpClient.cs
  23. 1 1
      dotnet/Vit/Vit.Core/Vit.Core/Vit.Core.csproj
  24. 1 1
      dotnet/Vit/Vit.Ioc/Vit.Ioc/Vit.Ioc.csproj
  25. 1 1
      dotnet/Vit/Vit.Net.Http.FormFile/Vit.Net.Http.FormFile.csproj
  26. 1 1
      dotnet/Vit/Vit.WebHost/Vit.WebHost.csproj
  27. 1 1
      dotnet/netcore/Gateway/App.Gateway/App.Gateway.csproj
  28. 1 1
      dotnet/netcore/ServiceCenter/App.Gover.Gateway/App.Gover.Gateway.csproj
  29. 1 1
      dotnet/netcore/ServiceCenter/App.ServiceCenter/App.ServiceCenter.csproj
  30. 1 1
      dotnet/netcore/Station/App.Ioc.Station/App.Ioc.Station.csproj
  31. 1 1
      dotnet/netcore/Station/App.Robot.Station/App.Robot.Station.csproj

+ 1 - 1
dotnet/Sers/ApiLoader/Sers.NetcoreLoader/Sers.NetcoreLoader.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/Sers/ApiLoader/Sers.Serslot/Sers.Serslot.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/Sers/Sers.CL/Ipc/Sers.CL.Ipc.SharedMemory/Sers.CL.Ipc.SharedMemory.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Sers.CL.Socket.Iocp.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/Sers/Sers.CL/Socket/Sers.CL.Socket.ThreadWait/Sers.CL.Socket.ThreadWait.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/Sers/Sers.CL/WebSocket/Sers.CL.WebSocket/Sers.CL.WebSocket.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/Sers/Sers.CL/Zmq/FullDuplex/Sers.CL.Zmq.FullDuplex/Sers.CL.Zmq.FullDuplex.csproj

@@ -3,7 +3,7 @@
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
   

+ 1 - 1
dotnet/Sers/Sers.CL/Zmq/ThreadWait/Sers.CL.ClrZmq.ThreadWait/Sers.CL.ClrZmq.ThreadWait.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
   

+ 65 - 29
dotnet/Sers/Sers.Core/Sers.Core/Module/Api/ApiClient.cs

@@ -6,12 +6,13 @@ using System.Threading;
 using System.Threading.Tasks;
 using Sers.Core.Module.Message;
 using Vit.Core.Util.ComponentModel.SsError;
+using Sers.Core.Module.Rpc;
 
 namespace Sers.Core.Module.Api
 {
     public class ApiClient
     {
-        #region static
+        #region static Instance Instances
 
         public static readonly ApiClient Instance = new ApiClient();
         public static ApiClient[] Instances { get; private set; }
@@ -38,7 +39,7 @@ namespace Sers.Core.Module.Api
 
 
 
-        #region ApiClient
+        #region CallApi
 
         private Func<List<ArraySegment<byte>>, ArraySegment<byte>> OnSendRequest { get; set; }
 
@@ -83,6 +84,20 @@ namespace Sers.Core.Module.Api
             }
         }
 
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        public async Task<ApiMessage> CallApiAsync(ApiMessage request)
+        {
+            ApiMessage reply = null;
+            await Task.Run(() => { reply = CallApi(request); });
+            return reply;
+        }
+
+
         #endregion
 
 
@@ -95,10 +110,11 @@ namespace Sers.Core.Module.Api
         /// <param name="route"></param>
         /// <param name="arg"></param>
         /// <param name="httpMethod">可为 GET、POST、DELETE、PUT等,可不指定</param>
+        /// <param name="InitRpc">对Rpc的额外处理,如添加header</param>
         /// <returns></returns>
-        public ReturnType CallApi<ReturnType>(string route, Object arg, string httpMethod = null)
+        public ReturnType CallApi<ReturnType>(string route, Object arg = null, string httpMethod = null, Action<IRpcContextData> InitRpc = null)
         {
-            var apiRequestMessage = new ApiMessage().InitAsApiRequestMessage(route, arg, httpMethod);
+            var apiRequestMessage = new ApiMessage().InitAsApiRequestMessage(route, arg, httpMethod, InitRpc);
 
             var apiReplyMessage = CallApi(apiRequestMessage);
 
@@ -111,10 +127,11 @@ namespace Sers.Core.Module.Api
         /// <param name="route"></param>
         /// <param name="arg"></param>
         /// <param name="httpMethod">可为 GET、POST、DELETE、PUT等,可不指定</param>
+        /// <param name="InitRpc">对Rpc的额外处理,如添加header</param>
         /// <returns></returns>
-        public string CallApi(string route, Object arg, string httpMethod = null)
+        public string CallApi(string route, Object arg = null, string httpMethod = null, Action<IRpcContextData> InitRpc = null)
         {
-            return CallApi<string>(route, arg, httpMethod);
+            return CallApi<string>(route, arg, httpMethod, InitRpc);
         }
 
 
@@ -125,11 +142,12 @@ namespace Sers.Core.Module.Api
         /// <param name="route"></param>
         /// <param name="arg"></param>
         /// <param name="httpMethod">可为 GET、POST、DELETE、PUT等,可不指定</param>
+        /// <param name="InitRpc">对Rpc的额外处理,如添加header</param>
         /// <returns></returns>
-        public async Task<ReturnType> CallApiAsync<ReturnType>(string route, Object arg, string httpMethod = null)
+        public async Task<ReturnType> CallApiAsync<ReturnType>(string route, Object arg = null, string httpMethod = null, Action<IRpcContextData> InitRpc = null)
         {
             ReturnType ret = default(ReturnType);
-            await Task.Run(() => { ret = CallApi<ReturnType>(route, arg, httpMethod); });
+            await Task.Run(() => { ret = CallApi<ReturnType>(route, arg, httpMethod,InitRpc); });
             return ret;
         }
 
@@ -140,31 +158,31 @@ namespace Sers.Core.Module.Api
 
 
 
-
-
-        #region CallRemoteApi 扩展
+        #region static CallRemoteApi 扩展
 
         /// <summary>
         /// 
         /// </summary>
-        /// <param name="route"></param>
-        /// <param name="arg"></param>
-        /// <param name="httpMethod">可为 GET、POST、DELETE、PUT等,可不指定</param>
-        public static string CallRemoteApi(string route, string arg, string httpMethod = null)
+        /// <param name="request"></param>
+        /// <returns></returns>
+        public static ApiMessage CallRemoteApi(ApiMessage request)
         {
-            return Instance.CallApi(route, arg, httpMethod);
+            return Instance.CallApi(request);
         }
 
-       
+
         /// <summary>
         /// 
         /// </summary>
-        /// <param name="request"></param>
-        /// <returns></returns>
-        public static ApiMessage CallRemoteApi(ApiMessage request)
+        /// <param name="route"></param>
+        /// <param name="arg"></param>
+        /// <param name="httpMethod">可为 GET、POST、DELETE、PUT等,可不指定</param>
+        /// <param name="InitRpc">对Rpc的额外处理,如添加header</param>
+        public static string CallRemoteApi(string route, string arg, string httpMethod = null, Action<IRpcContextData> InitRpc = null)
         {
-            return Instance.CallApi(request); 
-        }
+            return Instance.CallApi(route, arg, httpMethod, InitRpc);
+        }       
+        
 
         /// <summary>
         /// 
@@ -172,9 +190,10 @@ namespace Sers.Core.Module.Api
         /// <param name="route"></param>
         /// <param name="arg"></param>
         /// <param name="httpMethod">可为 GET、POST、DELETE、PUT等,可不指定</param>
-        public static string CallRemoteApi(string route, Object arg, string httpMethod = null)
+        /// <param name="InitRpc">对Rpc的额外处理,如添加header</param>
+        public static string CallRemoteApi(string route, Object arg = null, string httpMethod = null, Action<IRpcContextData> InitRpc = null)
         {
-            return Instance.CallApi(route, arg, httpMethod);
+            return Instance.CallApi(route, arg, httpMethod, InitRpc);
         }
 
         /// <summary>
@@ -184,12 +203,28 @@ namespace Sers.Core.Module.Api
         /// <param name="route"></param>
         /// <param name="arg"></param>
         /// <param name="httpMethod">可为 GET、POST、DELETE、PUT等,可不指定</param>
+        /// <param name="InitRpc">对Rpc的额外处理,如添加header</param>
         /// <returns></returns>
-        public static ReturnType CallRemoteApi<ReturnType>(string route, Object arg, string httpMethod = null)
+        public static ReturnType CallRemoteApi<ReturnType>(string route, Object arg = null, string httpMethod = null, Action<IRpcContextData> InitRpc = null)
         {
-            return Instance.CallApi<ReturnType>(route, arg, httpMethod);
+            return Instance.CallApi<ReturnType>(route, arg, httpMethod, InitRpc);
+        }
+
+
+
+
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        public static async Task<ApiMessage> CallRemoteApiAsync(ApiMessage request)
+        {   
+            return await Instance.CallApiAsync(request);
         }
 
+
         /// <summary>
         /// 
         /// </summary>
@@ -197,13 +232,14 @@ namespace Sers.Core.Module.Api
         /// <param name="route"></param>
         /// <param name="arg"></param>
         /// <param name="httpMethod">可为 GET、POST、DELETE、PUT等,可不指定</param>
+        /// <param name="InitRpc">对Rpc的额外处理,如添加header</param>
         /// <returns></returns>
-        public static Task<ReturnType> CallRemoteApiAsync<ReturnType>(string route, Object arg, string httpMethod = null)
+        public static async Task<ReturnType> CallRemoteApiAsync<ReturnType>(string route, Object arg = null, string httpMethod = null, Action<IRpcContextData> InitRpc = null)
         {
-            return Instance.CallApiAsync<ReturnType>(route, arg, httpMethod);
+            return await Instance.CallApiAsync<ReturnType>(route, arg, httpMethod, InitRpc);
         }
         #endregion
 
-       
+
     }
 }

+ 31 - 0
dotnet/Sers/Sers.Core/Sers.Core/Module/Api/Rpc/Extendsions/IRpcContextDataExtensions.cs

@@ -38,6 +38,37 @@ namespace Vit.Extensions
         {
             return Init(rpcData, callerSource.EnumToString());
         }
+
+
+        public static IRpcContextData Init(this IRpcContextData rpcData, string url, string httpMethod = null)
+        {
+            //(x.1)设置url
+            rpcData.http_url_Set("http://sers.internal" + url);       
+
+            #region (x.2)设置route
+            //去除query string(url ?后面的字符串)           
+            {
+                //问号的位置
+                var queryIndex = url.IndexOf('?');
+
+                // b2?a=c
+                if (queryIndex >= 0)
+                {
+                    rpcData.route = url.Substring(0, queryIndex);
+                }
+                else
+                {
+                    rpcData.route = url;
+                }
+            }
+            #endregion
+
+            //(x.3)设置httpMethod
+            if (httpMethod != null) rpcData.http_method_Set(httpMethod);   
+
+            return rpcData;
+        }
+
         #endregion
 
         #region InitFromRpcContext

+ 29 - 45
dotnet/Sers/Sers.Core/Sers.Core/Module/Message/Extendsions/ApiMessageExtensions.cs

@@ -29,60 +29,28 @@ namespace Vit.Extensions
 
             return data;
         }
-     
 
-    
- 
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="apiRequestMessage"></param>
-        /// <param name="url"> /api/cotrollers1/value?name=lith </param>
-        /// <param name="arg"></param>
-        /// <param name="httpMethod">可为 GET、POST、DELETE、PUT等,可不指定</param>
-        /// <returns></returns>
-        public static ApiMessage InitAsApiRequestMessage(this ApiMessage apiRequestMessage, string url, Object arg=null,string httpMethod=null)
-        {   
-
-            var rpcData = RpcFactory.Instance.CreateRpcContextData().InitFromRpcContext();
-
-            //(x.1)设置url
-            rpcData.http_url_Set("http://sers.internal" + url);
-
-            //问号的位置
-            var queryIndex = url.IndexOf('?');
-
-            #region (x.2)设置route
-            //去除query string(url ?后面的字符串)           
-            {
-                // b2?a=c
-                if (queryIndex >= 0)
-                {
-                    rpcData.route = url.Substring(0, queryIndex);
-                }
-                else
-                {
-                    rpcData.route = url;
-                }
-            }
-            #endregion
-
-            #region (x.3)设置body
+        public static ApiMessage SetValue(this ApiMessage apiRequestMessage, string url, Object arg = null)
+        {
+            #region (x.2)设置body
             {
                 ArraySegment<byte> bodyData;
                 if (arg != null && (bodyData = arg.SerializeToArraySegmentByte()).HasData())
                 {
                     apiRequestMessage.value_OriData = bodyData;
                 }
-                else 
+                else
                 {
+                    //问号的位置
+                    var queryIndex = url.IndexOf('?');
+
                     //从 query获取数据
                     if (queryIndex >= 0)
                     {
                         try
                         {
                             // ?a=1&b=2
-                            var query = url.Substring(queryIndex );
+                            var query = url.Substring(queryIndex);
                             var kvs = System.Web.HttpUtility.ParseQueryString(query);
 
                             JObject data = new JObject();
@@ -94,20 +62,36 @@ namespace Vit.Extensions
                             apiRequestMessage.value_OriData = data.SerializeToArraySegmentByte();
                         }
                         catch (Exception ex)
-                        {                           
-                        }                       
+                        {
+                        }
                     }
                 }
-                
             }
             #endregion
 
-                       
-            if (httpMethod != null) rpcData.http_method_Set(httpMethod);
+            return apiRequestMessage;
+        }
 
 
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="apiRequestMessage"></param>
+        /// <param name="url"> /api/cotrollers1/value?name=lith </param>
+        /// <param name="arg"></param>
+        /// <param name="httpMethod">可为 GET、POST、DELETE、PUT等,可不指定</param>
+        /// <param name="InitRpc">对Rpc的额外处理,如添加header</param>
+        /// <returns></returns>
+        public static ApiMessage InitAsApiRequestMessage(this ApiMessage apiRequestMessage, string url, Object arg=null,string httpMethod=null,Action<IRpcContextData>InitRpc=null)
+        {   
+            //(x.1)初始化rpcData
+            var rpcData = RpcFactory.Instance.CreateRpcContextData().InitFromRpcContext().Init(url, httpMethod);
+            InitRpc?.Invoke(rpcData);
             apiRequestMessage.RpcContextData_OriData_Set(rpcData);
 
+            //(x.2)设置body
+            SetValue(apiRequestMessage, url,arg);    
+
             return apiRequestMessage;
         }
         #endregion

+ 1 - 1
dotnet/Sers/Sers.Core/Sers.Core/Sers.Core.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/Sers/Sers.Gateway/Sers.Gateway/Sers.Gateway.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/Sers/Sers.Hardware/Sers.Hardware/Sers.Hardware.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/Sers/Sers.Ioc/Sers.Ioc/Sers.Ioc.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/Sers/Sers.ServiceCenter/Sers.Gover/Sers.Gover.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
   </PropertyGroup>
 
   <PropertyGroup>

+ 1 - 1
dotnet/Sers/Sers.ServiceCenter/Sers.ServiceCenter/Sers.ServiceCenter.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
   </PropertyGroup>
 
 

+ 1 - 1
dotnet/Sers/Sers.ServiceStation/Sers.ServiceStation/Sers.ServiceStation.csproj

@@ -3,7 +3,7 @@
  
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/StationDemo/SersLoader/Did.SersLoader.Demo/Did.SersLoader.Demo.csproj

@@ -3,7 +3,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <TargetFramework>netcoreapp2.1</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>

+ 1 - 1
dotnet/StationDemo/SersLoader/Did.SersLoader.HelloWorld/Did.SersLoader.HelloWorld.csproj

@@ -3,7 +3,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <TargetFramework>netcoreapp2.1</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/Vit/Vit.Core/Vit.Core/Module/Serialization/Serialization.cs

@@ -296,7 +296,7 @@ namespace Vit.Core.Module.Serialization
             }
             if (obj is byte[] bytes)
             {
-                return bytes.SerializeToArraySegmentByte();
+                return bytes.BytesToArraySegmentByte();
             }
 
             if (!(obj is string strValue))

+ 18 - 20
dotnet/Vit/Vit.Core/Vit.Core/Util/Net/HttpClient.cs

@@ -23,7 +23,7 @@ namespace Vit.Core.Util.Net
         /// <returns></returns>
         public async Task<HttpResponse<T>> SendAsync<T>(HttpRequest request)
         {
-            #region (x.1)构建HttpRequest            
+            #region (x.1)构建请求            
 
             #region (x.x.1)创建对象           
             var url = request.url;
@@ -31,31 +31,31 @@ namespace Vit.Core.Util.Net
             {
                 url = UrlAddParams(url, request.urlParams);
             }
-            HttpRequestMessage httpResquest = new HttpRequestMessage(new HttpMethod(request.httpMethod ?? "GET"), url);
-            #endregion
-
-            #region (x.x.2)headers
-            if (request.headers != null)
-            {
-                foreach (var item in request.headers)
-                {
-                    httpResquest.Headers.Add(item.Key, item.Value);
-                }
-            }
-            #endregion
+            HttpRequestMessage httpRequest = new HttpRequestMessage(new HttpMethod(request.httpMethod ?? "GET"), url);
+            #endregion          
 
 
-            #region (x.x.3)body
+            #region (x.x.2)body
             if (request.body != null)
             {
                 if (request.body is byte[] bytes)
                 {
-                    httpResquest.Content = new ByteArrayContent(bytes);
+                    httpRequest.Content = new ByteArrayContent(bytes);
                 }
                 else
                 {
                     var content = Serialization.Instance.SerializeToString(request.body);
-                    httpResquest.Content = new StringContent(content, request.requestEncoding, "application/json");
+                    httpRequest.Content = new StringContent(content, request.requestEncoding, "application/json");
+                }
+            }
+            #endregion
+
+            #region (x.x.3)headers
+            if (request.headers != null)
+            {
+                foreach (var item in request.headers)
+                {
+                    httpRequest.Content.Headers.Add(item.Key, item.Value);
                 }
             }
             #endregion
@@ -64,14 +64,13 @@ namespace Vit.Core.Util.Net
             #endregion
 
             //(x.2)发送请求
-            var response = await http.SendAsync(httpResquest);
+            var response = await http.SendAsync(httpRequest);
 
             #region (x.3)读取回应
             var httpResponse = new HttpResponse<T>();
             httpResponse.StatusCode = (int)response.StatusCode;
 
-            httpResponse.headers = response.Headers?.AsEnumerable().ToDictionary(kv => kv.Key, kv => string.Join(",", kv.Value));
-
+            httpResponse.headers = response.Content?.Headers?.AsEnumerable().ToDictionary(kv => kv.Key, kv => string.Join(",", kv.Value));
 
             if (response.IsSuccessStatusCode)
             {
@@ -85,7 +84,6 @@ namespace Vit.Core.Util.Net
                     string data = await response.Content.ReadAsStringAsync();
                     httpResponse.data = data.Deserialize<T>();
                 }
-
             }
             return httpResponse;
             #endregion

+ 1 - 1
dotnet/Vit/Vit.Core/Vit.Core/Vit.Core.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/Vit/Vit.Ioc/Vit.Ioc/Vit.Ioc.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/Vit/Vit.Net.Http.FormFile/Vit.Net.Http.FormFile.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/Vit/Vit.WebHost/Vit.WebHost.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/netcore/Gateway/App.Gateway/App.Gateway.csproj

@@ -3,7 +3,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <TargetFramework>netcoreapp2.1</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/netcore/ServiceCenter/App.Gover.Gateway/App.Gover.Gateway.csproj

@@ -3,7 +3,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <TargetFramework>netcoreapp2.1</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/netcore/ServiceCenter/App.ServiceCenter/App.ServiceCenter.csproj

@@ -3,7 +3,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <TargetFramework>netcoreapp2.1</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/netcore/Station/App.Ioc.Station/App.Ioc.Station.csproj

@@ -3,7 +3,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <TargetFramework>netcoreapp2.1</TargetFramework>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>
 

+ 1 - 1
dotnet/netcore/Station/App.Robot.Station/App.Robot.Station.csproj

@@ -4,7 +4,7 @@
     <OutputType>Exe</OutputType>
     <TargetFramework>netcoreapp2.1</TargetFramework>
     <RunPostBuildEvent>Always</RunPostBuildEvent>
-    <Version>2.1.1.322</Version>
+    <Version>2.1.1.323</Version>
     <Description>https://github.com/sersms/Sers/tree/2.1.1/release</Description>
   </PropertyGroup>