using System.ComponentModel.DataAnnotations;
namespace DramaLing.Api.Models.Configuration;
///
/// 選項詞彙庫服務配置選項
///
public class OptionsVocabularyOptions
{
public const string SectionName = "OptionsVocabulary";
///
/// 快取過期時間(分鐘)
///
[Range(1, 60)]
public int CacheExpirationMinutes { get; set; } = 5;
///
/// 最小詞彙庫門檻(用於判斷是否有足夠詞彙)
///
[Range(1, 100)]
public int MinimumVocabularyThreshold { get; set; } = 5;
///
/// 詞彙長度差異範圍(目標詞彙長度 ± 此值)
///
[Range(0, 10)]
public int WordLengthTolerance { get; set; } = 2;
///
/// 快取大小限制(項目數量)
///
[Range(10, 1000)]
public int CacheSizeLimit { get; set; } = 100;
///
/// 是否啟用詳細日誌記錄
///
public bool EnableDetailedLogging { get; set; } = false;
///
/// 是否啟用快取預熱
///
public bool EnableCachePrewarm { get; set; } = false;
///
/// 快取預熱的詞彙組合(用於常見查詢)
///
public List PrewarmCombinations { get; set; } = new()
{
new() { CEFRLevel = "A1", PartOfSpeech = "noun" },
new() { CEFRLevel = "A2", PartOfSpeech = "noun" },
new() { CEFRLevel = "B1", PartOfSpeech = "noun" },
new() { CEFRLevel = "B1", PartOfSpeech = "adjective" },
new() { CEFRLevel = "B1", PartOfSpeech = "verb" }
};
}
///
/// 快取預熱組合
///
public class PrewarmCombination
{
public string CEFRLevel { get; set; } = string.Empty;
public string PartOfSpeech { get; set; } = string.Empty;
}