REFACTOR external service and improve websocket training
This commit is contained in:
@@ -106,6 +106,12 @@ async def proxy_tenant_traffic(request: Request, tenant_id: str = Path(...), pat
|
||||
target_path = f"/api/v1/tenants/{tenant_id}/traffic/{path}".rstrip("/")
|
||||
return await _proxy_to_external_service(request, target_path)
|
||||
|
||||
@router.api_route("/{tenant_id}/external/{path:path}", methods=["GET", "POST", "OPTIONS"])
|
||||
async def proxy_tenant_external(request: Request, tenant_id: str = Path(...), path: str = ""):
|
||||
"""Proxy tenant external service requests (v2.0 city-based optimized endpoints)"""
|
||||
target_path = f"/api/v1/tenants/{tenant_id}/external/{path}".rstrip("/")
|
||||
return await _proxy_to_external_service(request, target_path)
|
||||
|
||||
@router.api_route("/{tenant_id}/analytics/{path:path}", methods=["GET", "POST", "OPTIONS"])
|
||||
async def proxy_tenant_analytics(request: Request, tenant_id: str = Path(...), path: str = ""):
|
||||
"""Proxy tenant analytics requests to sales service"""
|
||||
@@ -144,6 +150,12 @@ async def proxy_tenant_statistics(request: Request, tenant_id: str = Path(...)):
|
||||
# TENANT-SCOPED FORECASTING SERVICE ENDPOINTS
|
||||
# ================================================================
|
||||
|
||||
@router.api_route("/{tenant_id}/forecasting/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"])
|
||||
async def proxy_tenant_forecasting(request: Request, tenant_id: str = Path(...), path: str = ""):
|
||||
"""Proxy tenant forecasting requests to forecasting service"""
|
||||
target_path = f"/api/v1/tenants/{tenant_id}/forecasting/{path}".rstrip("/")
|
||||
return await _proxy_to_forecasting_service(request, target_path, tenant_id=tenant_id)
|
||||
|
||||
@router.api_route("/{tenant_id}/forecasts/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"])
|
||||
async def proxy_tenant_forecasts(request: Request, tenant_id: str = Path(...), path: str = ""):
|
||||
"""Proxy tenant forecast requests to forecasting service"""
|
||||
|
||||
Reference in New Issue
Block a user