清理多余引用
continuous-integration/drone/push Build is passing

This commit is contained in:
hang
2024-10-13 16:31:09 +08:00
parent 0206947202
commit e65227c7bf
43 changed files with 419 additions and 507 deletions
@@ -2,7 +2,6 @@
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using StackExchange.Redis;
using System;
using System.Globalization;
@@ -14,9 +13,9 @@ namespace IRaCIS.Core.API
public class JSONTimeZoneConverter(IHttpContextAccessor _httpContextAccessor) : DateTimeConverterBase
{
private TimeZoneInfo _clientTimeZone;
private TimeZoneInfo _clientTimeZone;
private string _dateFormat;
private string _dateFormat;
@@ -59,7 +58,7 @@ namespace IRaCIS.Core.API
// 仅支持 DateTime 类型的转换
return objectType == typeof(DateTime)|| objectType == typeof(DateTime?);
return objectType == typeof(DateTime) || objectType == typeof(DateTime?);
}
@@ -93,20 +92,20 @@ namespace IRaCIS.Core.API
return null;
}
}
// 将客户端时间转换为服务器时区的时间
var serverZoneTime = TimeZoneInfo.ConvertTime(dateTime, _clientTimeZone, TimeZoneInfo.Local);
return serverZoneTime;
}
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
{
DateTime? nullableDateTime = value as DateTime?;
if (nullableDateTime != null && nullableDateTime.HasValue)
@@ -121,7 +120,7 @@ namespace IRaCIS.Core.API
else
{
writer.WriteNull();
}
}
}
}