Skip to content

Commit

Permalink
v3.0.2024.0801
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Aug 1, 2024
1 parent 9295a72 commit ea35dc9
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 31 deletions.
6 changes: 1 addition & 5 deletions NewLife.Remoting/Clients/ServerTimeProvider.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using NewLife.Remoting.Clients;
namespace NewLife.Remoting.Clients;

namespace NewLife.Remoting.Clients;

#if !NET40
/// <summary>基于服务器时间差的时间提供者</summary>
public class ServerTimeProvider : TimeProvider
{
Expand All @@ -13,4 +10,3 @@ public class ServerTimeProvider : TimeProvider
/// <returns></returns>
public override DateTimeOffset GetUtcNow() => Client != null ? DateTime.UtcNow.Add(Client.Span) : base.GetUtcNow();
}
#endif
8 changes: 0 additions & 8 deletions NewLife.Remoting/Http/HttpEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ public class HttpEncoder : EncoderBase, IEncoder
if (ctype.Contains("application/json"))
{
// 返回类型可能是列表而不是字典
#if NET40
var obj = new JsonParser(str).Decode();
#else
var obj = JsonHost.Parse(str);
#endif

if (obj is not IDictionary<String, Object?> dic)
return obj;
Expand Down Expand Up @@ -120,11 +116,7 @@ public class HttpEncoder : EncoderBase, IEncoder
if (returnType == null || returnType == typeof(String)) return json;

// 返回类型可能是列表而不是字典
#if NET40
var rs = new JsonParser(json).Decode();
#else
var rs = JsonHost.Parse(json);
#endif
if (rs == null) return null;
if (returnType == typeof(Object)) return rs;

Expand Down
8 changes: 0 additions & 8 deletions NewLife.Remoting/JsonEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ public virtual Packet Encode(String action, Int32? code, Packet? value)
if (json.IsNullOrEmpty() || json[0] != '{' && json[0] != '[') return json;

// 返回类型可能是列表而不是字典
#if NET40
return new JsonParser(json).Decode();
#else
return JsonHost.Parse(json);
#endif
}

/// <summary>解码结果</summary>
Expand All @@ -84,11 +80,7 @@ public virtual Packet Encode(String action, Int32? code, Packet? value)
if (returnType == null || returnType == typeof(String)) return json;

// 返回类型可能是列表而不是字典
#if NET40
var rs = new JsonParser(json).Decode();
#else
var rs = JsonHost.Parse(json);
#endif
if (rs == null) return null;
if (returnType == typeof(Object)) return rs;

Expand Down
4 changes: 2 additions & 2 deletions NewLife.Remoting/NewLife.Remoting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'!='net40'">
<PackageReference Include="NewLife.Core" Version="10.10.2024.0723-beta1414" />
<PackageReference Include="NewLife.Core" Version="10.10.2024.0801" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net40'">
<PackageReference Include="NewLife.Core" Version="10.10.2024.0701-net40" />
<PackageReference Include="NewLife.Core" Version="10.10.2024.0801-net40" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Samples/IoTZero/IoTZero.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NewLife.Cube.Core" Version="6.1.2024.625-beta1720" />
<PackageReference Include="NewLife.Cube.Core" Version="6.1.2024.731-beta0906" />
<PackageReference Include="NewLife.IoT" Version="2.2.2024.706" />
<PackageReference Include="NewLife.MQTT" Version="2.0.2024.708" />
<PackageReference Include="NewLife.Redis" Version="5.7.2024.709" />
<PackageReference Include="NewLife.Stardust.Extensions" Version="3.0.2024.708" />
<PackageReference Include="NewLife.Stardust.Extensions" Version="3.0.2024.730-beta0516" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Samples/Zero.RpcServer/Zero.RpcServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

<ItemGroup>
<PackageReference Include="NewLife.Redis" Version="5.7.2024.709" />
<PackageReference Include="NewLife.Stardust" Version="3.0.2024.708" />
<PackageReference Include="NewLife.XCode" Version="11.13.2024.701" />
<PackageReference Include="NewLife.Stardust" Version="3.0.2024.730-beta0516" />
<PackageReference Include="NewLife.XCode" Version="11.14.2024.801-beta0147" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Samples/ZeroServer/ZeroServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NewLife.Cube.Core" Version="6.1.2024.625-beta1720" />
<PackageReference Include="NewLife.Cube.Core" Version="6.1.2024.731-beta0906" />
<PackageReference Include="NewLife.Redis" Version="5.7.2024.709" />
<PackageReference Include="NewLife.Stardust.Extensions" Version="3.0.2024.708" />
<PackageReference Include="NewLife.Stardust.Extensions" Version="3.0.2024.730-beta0516" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Test/Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NewLife.Core" Version="10.10.2024.723-beta1414" />
<PackageReference Include="NewLife.Core" Version="10.10.2024.801" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion XUnitTest/XUnitTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="NewLife.Core" Version="10.10.2024.723-beta1414" />
<PackageReference Include="NewLife.Core" Version="10.10.2024.801" />
<PackageReference Include="NewLife.UnitTest" Version="1.0.2023.1204" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
Expand Down

0 comments on commit ea35dc9

Please sign in to comment.