Files
congsh 5c028d7952 Initial commit: snapAna 截图智能整理工具
包含 FastAPI 后端、React 前端、队列/OCR/标签/待办等完整功能。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-27 15:45:50 +08:00

18 lines
337 B
Python

"""API 通用依赖。"""
from __future__ import annotations
from typing import Iterator
from sqlalchemy.orm import Session
from app.core.db import SessionLocal
def db_session() -> Iterator[Session]:
"""每请求一个会话。"""
session = SessionLocal()
try:
yield session
finally:
session.close()