using System.Collections.Generic; using Newtonsoft.Json; #nullable enable namespace BililiveRecorder.Core.Config.V2 { public class ConfigV2 : ConfigBase { public override int Version => 2; [JsonProperty("global")] public GlobalConfig Global { get; set; } = new GlobalConfig(); [JsonProperty("rooms")] public List Rooms { get; set; } = new List(); } public partial class RoomConfig { public RoomConfig() : base(x => x.AutoMap(p => new[] { "Has" + p.Name })) { } internal void SetParent(GlobalConfig? config) => this.Parent = config; public string? WorkDirectory => this.GetPropertyValue(); } public partial class GlobalConfig { public GlobalConfig() : base(x => x.AutoMap(p => new[] { "Has" + p.Name })) { this.Parent = DefaultConfig.Instance; } /// /// 当前工作目录 /// public string? WorkDirectory { get => this.GetPropertyValue(); set => this.SetPropertyValue(value); } } }