using System; using System.IO; namespace ClassNotify.Server.Configuration; /// /// 设备技术诊断包存储与生命周期配置选项 /// public class SupportBundleOptions { /// /// 诊断包根存储目录 (必须为绝对路径,若为空则自动使用默认或环境变量) /// public string? StorageRoot { get; set; } /// /// 解析最终生效的 StorageRoot 规范化绝对路径 /// public string GetEffectiveStorageRoot() { if (!string.IsNullOrWhiteSpace(StorageRoot)) { return Path.GetFullPath(StorageRoot); } var env = Environment.GetEnvironmentVariable("CLASSNOTIFY_SUPPORT_BUNDLE_STORAGE"); if (!string.IsNullOrWhiteSpace(env)) { return Path.GetFullPath(env); } return Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "storage", "support-bundles")); } }