Restructure: Move 43 files into 8 domain packages (backend-lehrer)
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 27s
CI / test-go-edu-search (push) Successful in 40s
CI / test-python-klausur (push) Failing after 2m30s
CI / test-python-agent-core (push) Successful in 28s
CI / test-nodejs-website (push) Successful in 20s
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 27s
CI / test-go-edu-search (push) Successful in 40s
CI / test-python-klausur (push) Failing after 2m30s
CI / test-python-agent-core (push) Successful in 28s
CI / test-nodejs-website (push) Successful in 20s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
57
backend-lehrer/units/api.py
Normal file
57
backend-lehrer/units/api.py
Normal file
@@ -0,0 +1,57 @@
|
||||
# ==============================================
|
||||
# Breakpilot Drive - Unit API (barrel re-export)
|
||||
# ==============================================
|
||||
# This module was split into:
|
||||
# - unit_models.py (Pydantic models)
|
||||
# - unit_helpers.py (Auth, DB, token, validation helpers)
|
||||
# - unit_routes.py (Definition, session, analytics routes)
|
||||
# - unit_content_routes.py (H5P, worksheet, PDF routes)
|
||||
#
|
||||
# The `router` object is assembled here by including all sub-routers.
|
||||
# Importers that did `from unit_api import router` continue to work.
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from .routes import router as _routes_router
|
||||
from .definition_routes import router as _definition_router
|
||||
from .content_routes import router as _content_router
|
||||
|
||||
# Re-export models for any direct importers
|
||||
from .models import ( # noqa: F401
|
||||
UnitDefinitionResponse,
|
||||
CreateSessionRequest,
|
||||
SessionResponse,
|
||||
TelemetryEvent,
|
||||
TelemetryPayload,
|
||||
TelemetryResponse,
|
||||
PostcheckAnswer,
|
||||
CompleteSessionRequest,
|
||||
SessionSummaryResponse,
|
||||
UnitListItem,
|
||||
RecommendedUnit,
|
||||
CreateUnitRequest,
|
||||
UpdateUnitRequest,
|
||||
ValidationError,
|
||||
ValidationResult,
|
||||
)
|
||||
|
||||
# Re-export helpers for any direct importers
|
||||
from .helpers import ( # noqa: F401
|
||||
get_optional_current_user,
|
||||
get_unit_database,
|
||||
create_session_token,
|
||||
verify_session_token,
|
||||
get_session_from_token,
|
||||
validate_unit_definition,
|
||||
USE_DATABASE,
|
||||
REQUIRE_AUTH,
|
||||
SECRET_KEY,
|
||||
)
|
||||
|
||||
# Assemble the combined router.
|
||||
# _routes_router and _content_router both use prefix="/api/units",
|
||||
# so we create a plain router and include them without extra prefix.
|
||||
router = APIRouter()
|
||||
router.include_router(_routes_router)
|
||||
router.include_router(_definition_router)
|
||||
router.include_router(_content_router)
|
||||
Reference in New Issue
Block a user