using DS.Module.Core.Helpers;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace DS.Module.Core;
public class CustomContractResolver : CamelCasePropertyNamesContractResolver
{
///
/// 对长整型做处理
///
///
///
protected override JsonConverter ResolveContractConverter(Type objectType)
{
if (objectType == typeof(long))
{
return new JsonConverterLong();
}
if (objectType == typeof(DateTime?) || objectType == typeof(DateTime))
{
return new DatetimeJsonConverter();
}
return base.ResolveContractConverter(objectType);
}
}