mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-20 18:51:28 +08:00
fix: orm 序列化
This commit is contained in:
@@ -8,6 +8,8 @@ using System.Text.Json;
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Text.Json.Serialization.Metadata;
|
using System.Text.Json.Serialization.Metadata;
|
||||||
|
|
||||||
|
using ThingsGateway.NewLife.Json.Extension;
|
||||||
|
|
||||||
using JsonProperty = Newtonsoft.Json.Serialization.JsonProperty;
|
using JsonProperty = Newtonsoft.Json.Serialization.JsonProperty;
|
||||||
|
|
||||||
namespace ThingsGateway.SqlSugar
|
namespace ThingsGateway.SqlSugar
|
||||||
@@ -23,8 +25,10 @@ namespace ThingsGateway.SqlSugar
|
|||||||
|
|
||||||
private static readonly JsonSerializerOptions _systemTextJsonSettings = new()
|
private static readonly JsonSerializerOptions _systemTextJsonSettings = new()
|
||||||
{
|
{
|
||||||
|
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
|
||||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
||||||
|
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals,
|
||||||
};
|
};
|
||||||
|
|
||||||
private static readonly ConcurrentDictionary<Type, SugarColumn> _typeInfoCache = new();
|
private static readonly ConcurrentDictionary<Type, SugarColumn> _typeInfoCache = new();
|
||||||
@@ -52,6 +56,11 @@ namespace ThingsGateway.SqlSugar
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
_systemTextJsonSettings.Converters.Add(new JTokenSystemTextJsonConverter());
|
||||||
|
_systemTextJsonSettings.Converters.Add(new JValueSystemTextJsonConverter());
|
||||||
|
_systemTextJsonSettings.Converters.Add(new JObjectSystemTextJsonConverter());
|
||||||
|
_systemTextJsonSettings.Converters.Add(new JArraySystemTextJsonConverter());
|
||||||
_systemTextJsonSettings.TypeInfoResolver = resolver;
|
_systemTextJsonSettings.TypeInfoResolver = resolver;
|
||||||
}
|
}
|
||||||
public static bool UseNewtonsoftJson = false;
|
public static bool UseNewtonsoftJson = false;
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<Project>
|
<Project>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PluginVersion>10.11.90</PluginVersion>
|
<PluginVersion>10.11.92</PluginVersion>
|
||||||
<ProPluginVersion>10.11.90</ProPluginVersion>
|
<ProPluginVersion>10.11.92</ProPluginVersion>
|
||||||
<DefaultVersion>10.11.90</DefaultVersion>
|
<DefaultVersion>10.11.92</DefaultVersion>
|
||||||
<AuthenticationVersion>10.11.6</AuthenticationVersion>
|
<AuthenticationVersion>10.11.6</AuthenticationVersion>
|
||||||
<SourceGeneratorVersion>10.11.6</SourceGeneratorVersion>
|
<SourceGeneratorVersion>10.11.6</SourceGeneratorVersion>
|
||||||
<NET8Version>8.0.20</NET8Version>
|
<NET8Version>8.0.20</NET8Version>
|
||||||
|
Reference in New Issue
Block a user