Initial commit: snapAna 截图智能整理工具
包含 FastAPI 后端、React 前端、队列/OCR/标签/待办等完整功能。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
"""截图的 OCR / AI 元信息。与 screenshot 1:1。"""
|
||||
from __future__ import annotations
|
||||
|
||||
from sqlalchemy import ForeignKey, Integer, Text
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from app.core.db import Base
|
||||
|
||||
|
||||
class ScreenshotMeta(Base):
|
||||
"""OCR 文本 + AI 结构化结果。"""
|
||||
|
||||
__tablename__ = "screenshot_meta"
|
||||
|
||||
screenshot_id: Mapped[int] = mapped_column(
|
||||
Integer,
|
||||
ForeignKey("screenshots.id", ondelete="CASCADE"),
|
||||
primary_key=True,
|
||||
)
|
||||
|
||||
ocr_text: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
ai_title: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
ai_summary: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
ai_suggestion: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
ai_raw_json: Mapped[str | None] = mapped_column(Text, nullable=True) # 完整原始 JSON
|
||||
|
||||
screenshot = relationship("Screenshot", back_populates="meta")
|
||||
Reference in New Issue
Block a user