TT-004: complete modular frontend integration
This commit is contained in:
@@ -7,11 +7,11 @@ export default defineConfig({
|
||||
port: 5174,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8000',
|
||||
target: 'http://localhost:8001',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/platform-api': {
|
||||
target: 'http://localhost:8001',
|
||||
target: 'http://localhost:8000',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/platform-api/, '/api'),
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"""Request Management Module."""
|
||||
"""Request Management Module."""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import List, Optional
|
||||
from typing import List, Optional, Dict, Any
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app.core.sdk.module import BaseModule
|
||||
from app.core.sdk.module import BaseModule, FrontendInfo
|
||||
|
||||
_module_dir = Path(__file__).parent
|
||||
|
||||
@@ -17,6 +17,10 @@ class RequestModule(BaseModule):
|
||||
name = "Request Management"
|
||||
version = "1.0.0"
|
||||
description = "Модуль управления заявками"
|
||||
frontend = FrontendInfo(
|
||||
dev_url="http://localhost:5174",
|
||||
prod_path="/modules/request",
|
||||
)
|
||||
|
||||
def __init__(self):
|
||||
self._module_dir = _module_dir
|
||||
@@ -58,6 +62,7 @@ class RequestModule(BaseModule):
|
||||
return self._routers
|
||||
|
||||
def routers(self) -> List[APIRouter]:
|
||||
"""Return API routers for the request module."""
|
||||
return self._load_routers()
|
||||
|
||||
def permissions(self) -> List[str]:
|
||||
|
||||
@@ -34,3 +34,17 @@ async def health_check_db(db: Session = Depends(get_db)):
|
||||
"database": "PostgreSQL",
|
||||
"error": str(e)
|
||||
}
|
||||
|
||||
|
||||
@router.get("/module/info")
|
||||
async def module_info():
|
||||
"""Return module metadata for platform registration."""
|
||||
return {
|
||||
"id": "request",
|
||||
"name": "Request Management",
|
||||
"version": "1.0.0",
|
||||
"frontend": {
|
||||
"dev_url": "http://localhost:5174",
|
||||
"prod_path": "/modules/request",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,6 +274,6 @@ if __name__ == "__main__":
|
||||
uvicorn.run(
|
||||
"app.main:app",
|
||||
host="0.0.0.0",
|
||||
port=8000,
|
||||
port=8001,
|
||||
reload=get_settings().APP_DEBUG
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user