from fastapi import APIRouter
from app.api.dependencies import ServiceContainer
from app.api.schemas import SystemStatus

def create_general_router(services: ServiceContainer) -> APIRouter:
    router = APIRouter(tags=["General"])

    @router.get("/", summary="Check Service Status")
    def read_root():
        return {"status": "AI Model Hub is running!"}

    @router.get("/status", response_model=SystemStatus, summary="Get Full System Status")
    def get_status():
        settings = services.settings()
        return SystemStatus(
            status="running",
            oidc_enabled=settings.OIDC_ENABLED,
            tls_enabled=settings.GRPC_TLS_ENABLED,
            external_endpoint=settings.GRPC_EXTERNAL_ENDPOINT,
            version=settings.VERSION
        )
    
    return router