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