refactor(phase3-session-b1): extract upscale, control, social, health into sub-routers

Extracted 4 endpoint groups into separate sub-router modules:
- health.py: 1 endpoint (GET /health)
- upscale.py: 1 endpoint (POST /upscale)
- control.py: 2 endpoints (POST /control/process, GET /control/operations)
- social.py: 2 endpoints (POST /social/optimize, GET /social/platforms/{platform}/formats)

__init__.py now composes these sub-routers into the legacy router.
All 33 routes preserved. No functional changes.
This commit is contained in:
ajaysi
2026-05-09 09:52:32 +05:30
parent 19a5af9682
commit 463cfdc5cf
6 changed files with 226 additions and 185 deletions

View File

@@ -1,9 +1,19 @@
"""Image Studio API router package.
Assembled from modular sub-routers. Same prefix and tags as the original monolithic file.
Currently re-exports from the legacy router. Sub-routers will be added in subsequent sessions.
Composed from modular sub-routers. Same prefix and tags as the original monolithic file.
"""
from ..image_studio_router import router
from ..image_studio_router import router as legacy_router
from .health import router as health_router
from .upscale import router as upscale_router
from .control import router as control_router
from .social import router as social_router
legacy_router.include_router(health_router)
legacy_router.include_router(upscale_router)
legacy_router.include_router(control_router)
legacy_router.include_router(social_router)
router = legacy_router
__all__ = ["router"]