TT-002: modular router registration and module infrastructure

This commit is contained in:
Арсентьев Александр
2026-08-06 13:21:26 +03:00
parent fee93bc855
commit 4ede56d716
8 changed files with 391 additions and 11 deletions
+16 -2
View File
@@ -1,6 +1,7 @@
"""Request Management Module."""
from typing import List
from pathlib import Path
from typing import List, Optional
from fastapi import APIRouter
from app.core.sdk.module import BaseModule
@@ -18,7 +19,10 @@ class RequestModule(BaseModule):
version = "1.0.0"
description = "Модуль управления заявками"
def routes(self) -> List[APIRouter]:
def __init__(self):
self._module_dir = Path(__file__).parent
def routers(self) -> List[APIRouter]:
"""Return API routers for the request module.
Currently returns empty list - routes will be added
@@ -34,6 +38,16 @@ class RequestModule(BaseModule):
"request.delete",
]
def static_path(self) -> Optional[Path]:
"""Return path to static files directory."""
static = self._module_dir / "static"
return static if static.exists() else None
def templates_path(self) -> Optional[Path]:
"""Return path to templates directory."""
templates = self._module_dir / "templates"
return templates if templates.exists() else None
async def startup(self) -> None:
"""Initialize request module resources."""
pass