BililiveRecorder/BililiveRecorder.Core/Config/ConfigBase.cs

22 lines
732 B
C#
Raw Normal View History

2021-01-01 14:46:27 +08:00
using JsonSubTypes;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace BililiveRecorder.Core.Config
{
2021-12-19 20:58:32 +08:00
#pragma warning disable CS0618 // Type or member is obsolete
2021-01-01 14:46:27 +08:00
[JsonConverter(typeof(JsonSubtypes), nameof(Version))]
[JsonSubtypes.KnownSubType(typeof(V1.ConfigV1Wrapper), 1)]
[JsonSubtypes.KnownSubType(typeof(V2.ConfigV2), 2)]
2021-12-19 20:58:32 +08:00
[JsonSubtypes.KnownSubType(typeof(V3.ConfigV3), 3)]
#pragma warning restore CS0618 // Type or member is obsolete
2021-01-01 14:46:27 +08:00
public abstract class ConfigBase
{
2021-07-08 19:11:44 +08:00
[JsonProperty("$schema", Order = -2)]
public string? DollarSignSchema { get; set; }
2021-01-01 14:46:27 +08:00
[JsonProperty("version")]
public virtual int Version { get; internal protected set; }
}
}