validation services added
This commit is contained in:
@@ -29,8 +29,10 @@ COPY Services /app/Services
|
||||
# COPY Events/base_request_model.py /app/Events/base_request_model.py
|
||||
COPY Events/Engine /app/Events/Engine
|
||||
COPY Events/AllEvents/validations /app/Events/AllEvents/validations
|
||||
COPY Events/base_request_model.py /app/Events/base_request_model.py
|
||||
COPY DockerApiServices/ValidationServiceApi/events_file.py /app/Events/AllEvents/events_file.py
|
||||
|
||||
|
||||
# Set Python path to include app directory
|
||||
ENV PYTHONPATH=/app \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
|
||||
@@ -56,3 +56,9 @@ class MainConfig:
|
||||
DEFAULT_TIMEZONE = "GMT+3" # Default timezone for the application
|
||||
SYSTEM_TIMEZONE = "GMT+0" # System timezone (used for internal operations)
|
||||
SUPPORTED_TIMEZONES = ["GMT+0", "GMT+3"] # List of supported timezones
|
||||
|
||||
|
||||
class ValidationsConfig:
|
||||
|
||||
SUPPORTED_VALIDATIONS = ["header", "validation", "all"]
|
||||
DEFAULT_VALIDATION = "all"
|
||||
|
||||
@@ -12,8 +12,8 @@ This module provides functionality to create and configure a FastAPI application
|
||||
from fastapi import FastAPI
|
||||
from fastapi.responses import JSONResponse, RedirectResponse
|
||||
|
||||
from create_routes import get_all_routers
|
||||
from config import ApiConfig
|
||||
from create_routes import get_all_routers
|
||||
|
||||
|
||||
def create_app() -> FastAPI:
|
||||
|
||||
@@ -3,18 +3,17 @@ Route configuration and factory module.
|
||||
Handles dynamic route creation based on configurations.
|
||||
"""
|
||||
|
||||
from fastapi import Request
|
||||
from Events.Engine.set_defaults.setClusters import PrepareRouting
|
||||
from typing import Optional
|
||||
|
||||
from Events.Engine.set_defaults.run import get_cluster_controller_group
|
||||
from Events.Engine.set_defaults.setClusters import (
|
||||
PrepareRouting,
|
||||
SetItems2Redis,
|
||||
PrepareEvents,
|
||||
)
|
||||
|
||||
|
||||
async def health_check(request: Request):
|
||||
"""Default health check endpoint."""
|
||||
return {"status": "healthy", "message": "Service is running"}
|
||||
|
||||
|
||||
async def ping_test(request: Request, service_name: str = "base-router"):
|
||||
"""Default ping test endpoint."""
|
||||
return {"ping": "pong", "service": service_name}
|
||||
routers: Optional[PrepareRouting] = None
|
||||
|
||||
|
||||
def get_all_routers() -> PrepareRouting:
|
||||
@@ -22,10 +21,22 @@ def get_all_routers() -> PrepareRouting:
|
||||
Get all routers and protected routes from route configurations.
|
||||
|
||||
Returns:
|
||||
tuple: (routers, protected_routes)
|
||||
tuple: PrepareRouting
|
||||
"""
|
||||
from Events.Engine.set_defaults.run import get_cluster_controller_group
|
||||
global routers
|
||||
if routers:
|
||||
return routers
|
||||
|
||||
cluster_list = get_cluster_controller_group()
|
||||
prepare_routing = PrepareRouting(cluster_controller_group=cluster_list)
|
||||
return prepare_routing
|
||||
routers = PrepareRouting(cluster_controller_group=cluster_list)
|
||||
return routers
|
||||
|
||||
|
||||
# async def health_check(request: Request):
|
||||
# """Default health check endpoint."""
|
||||
# return {"status": "healthy", "message": "Service is running"}
|
||||
#
|
||||
#
|
||||
# async def ping_test(request: Request, service_name: str = "base-router"):
|
||||
# """Default ping test endpoint."""
|
||||
# return {"ping": "pong", "service": service_name}
|
||||
|
||||
Reference in New Issue
Block a user