namespace OrpaonVision.ConfigApp.Infrastructure.Options; /// /// 会话持久化选项。 /// public sealed class SessionPersistenceOptions { /// /// 是否启用会话持久化。 /// public bool EnablePersistence { get; set; } = true; /// /// 会话数据保留天数。 /// public int RetentionDays { get; set; } = 30; /// /// 是否启用自动清理。 /// public bool EnableAutoCleanup { get; set; } = true; /// /// 自动清理执行时间(小时)。 /// public int AutoCleanupHour { get; set; } = 2; // 凌晨2点执行 /// /// 批量操作大小。 /// public int BatchSize { get; set; } = 1000; /// /// 会话事件保留天数。 /// public int EventRetentionDays { get; set; } = 7; /// /// 是否启用会话压缩。 /// public bool EnableCompression { get; set; } = true; /// /// 数据库连接字符串。 /// public string ConnectionString { get; set; } = string.Empty; /// /// 会话表名。 /// public string SessionTableName { get; set; } = "mdl_production_session"; /// /// 会话事件表名。 /// public string EventTableName { get; set; } = "mdl_production_session_event"; /// /// 是否启用异步写入。 /// public bool EnableAsyncWrite { get; set; } = true; /// /// 异步写入队列大小。 /// public int AsyncWriteQueueSize { get; set; } = 10000; /// /// 异步写入批次大小。 /// public int AsyncWriteBatchSize { get; set; } = 100; /// /// 异步写入间隔(毫秒)。 /// public int AsyncWriteIntervalMs { get; set; } = 1000; /// /// 是否启用会话缓存。 /// public bool EnableCaching { get; set; } = true; /// /// 缓存过期时间(分钟)。 /// public int CacheExpirationMinutes { get; set; } = 30; /// /// 最大缓存大小。 /// public int MaxCacheSize { get; set; } = 10000; /// /// 是否启用会话备份。 /// public bool EnableBackup { get; set; } = true; /// /// 备份保留天数。 /// public int BackupRetentionDays { get; set; } = 90; /// /// 备份路径。 /// public string BackupPath { get; set; } = "backups/sessions"; /// /// 是否启用会话加密。 /// public bool EnableEncryption { get; set; } = false; /// /// 加密密钥。 /// public string EncryptionKey { get; set; } = string.Empty; }