"""数据模型定义."""

from dataclasses import dataclass, field
from typing import List


@dataclass
class ThesisMetadata:
    """论文元数据."""

    title: str = ""
    author: str = ""
    student_id: str = ""
    major: str = ""
    college: str = ""
    advisor: str = ""
    date: str = ""
    abstract_cn: str = ""
    abstract_en: str = ""
    keywords_cn: List[str] = field(default_factory=list)
    keywords_en: List[str] = field(default_factory=list)


@dataclass
class Section:
    """论文章节."""

    title: str
    level: int
    content: str = ""
    subsections: List["Section"] = field(default_factory=list)


@dataclass
class Reference:
    """参考文献."""

    index: int
    content: str


@dataclass
class ThesisContent:
    """论文内容结构."""

    metadata: ThesisMetadata
    sections: List[Section] = field(default_factory=list)
    references: List[Reference] = field(default_factory=list)
