62 lines
1.7 KiB
C#
62 lines
1.7 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using DramaLing.Api.Utils;
|
|
|
|
namespace DramaLing.Api.Models.Entities;
|
|
|
|
/// <summary>
|
|
/// 簡化的詞卡實體 - 使用數字難度等級
|
|
/// </summary>
|
|
public class Flashcard
|
|
{
|
|
private int? _difficultyLevelNumeric;
|
|
|
|
public Guid Id { get; set; }
|
|
|
|
public Guid UserId { get; set; }
|
|
|
|
// 詞卡內容
|
|
[Required]
|
|
[MaxLength(255)]
|
|
public string Word { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
public string Translation { get; set; } = string.Empty;
|
|
|
|
public string? Definition { get; set; }
|
|
|
|
[MaxLength(50)]
|
|
public string? PartOfSpeech { get; set; }
|
|
|
|
[MaxLength(255)]
|
|
public string? Pronunciation { get; set; }
|
|
|
|
public string? Example { get; set; }
|
|
|
|
public string? ExampleTranslation { get; set; }
|
|
|
|
[MaxLength(2000)]
|
|
public string? Synonyms { get; set; }
|
|
|
|
// 基本狀態
|
|
public bool IsFavorite { get; set; } = false;
|
|
|
|
public bool IsArchived { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// CEFR 難度等級 (數字格式: 0=未知, 1=A1, 2=A2, 3=B1, 4=B2, 5=C1, 6=C2)
|
|
/// </summary>
|
|
public int DifficultyLevelNumeric
|
|
{
|
|
get => _difficultyLevelNumeric ?? 0;
|
|
set => _difficultyLevelNumeric = value;
|
|
}
|
|
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
// Navigation Properties
|
|
public virtual User User { get; set; } = null!;
|
|
public virtual ICollection<FlashcardTag> FlashcardTags { get; set; } = new List<FlashcardTag>();
|
|
public virtual ICollection<ErrorReport> ErrorReports { get; set; } = new List<ErrorReport>();
|
|
public virtual ICollection<FlashcardExampleImage> FlashcardExampleImages { get; set; } = new List<FlashcardExampleImage>();
|
|
} |