2022-05-13 00:59:03 -07:00
|
|
|
|
using System.Text.Json;
|
2021-11-22 19:08:27 +01:00
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Administration.Logs.Converters;
|
|
|
|
|
|
|
2022-12-19 03:09:50 +01:00
|
|
|
|
public interface IAdminLogConverter
|
2021-11-22 19:08:27 +01:00
|
|
|
|
{
|
2022-12-19 03:09:50 +01:00
|
|
|
|
void Init(IDependencyCollection dependencies);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public abstract class AdminLogConverter<T> : JsonConverter<T>, IAdminLogConverter
|
|
|
|
|
|
{
|
|
|
|
|
|
public virtual void Init(IDependencyCollection dependencies)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-11-22 19:08:27 +01:00
|
|
|
|
public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new NotSupportedException();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public abstract override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options);
|
|
|
|
|
|
}
|