TT-002: modular router registration and module infrastructure
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user