Primera version estable de microservicios
This commit is contained in:
1
api/__init__.py
Normal file
1
api/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# API package
|
||||
1
api/api_v1/__init__.py
Normal file
1
api/api_v1/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# API v1 package
|
||||
14
api/api_v1/api.py
Normal file
14
api/api_v1/api.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from fastapi import APIRouter
|
||||
# En Python, no se pueden usar llaves {} para importar múltiples módulos.
|
||||
# Debes usar paréntesis () para hacer importaciones multilínea.
|
||||
from api.api_v1.endpoints import (
|
||||
health,
|
||||
pedimentos
|
||||
)
|
||||
|
||||
api_router = APIRouter()
|
||||
|
||||
# Incluir routers de endpoints
|
||||
api_router.include_router(health.router, tags=["health"])
|
||||
api_router.include_router(pedimentos.router, tags=["pedimentos"])
|
||||
|
||||
1
api/api_v1/endpoints/__init__.py
Normal file
1
api/api_v1/endpoints/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# Endpoints package
|
||||
22
api/api_v1/endpoints/health.py
Normal file
22
api/api_v1/endpoints/health.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from fastapi import APIRouter
|
||||
from core.config import settings
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("/health")
|
||||
async def health_check():
|
||||
"""Endpoint para verificar el estado del servicio"""
|
||||
return {
|
||||
"status": "healthy",
|
||||
"service": settings.APP_NAME,
|
||||
"version": settings.APP_VERSION
|
||||
}
|
||||
|
||||
@router.get("/")
|
||||
async def root():
|
||||
"""Endpoint raíz del microservicio"""
|
||||
return {
|
||||
"message": f"Bienvenido a {settings.APP_NAME}",
|
||||
"version": settings.APP_VERSION,
|
||||
"docs": "/docs"
|
||||
}
|
||||
1352
api/api_v1/endpoints/pedimentos.py
Normal file
1352
api/api_v1/endpoints/pedimentos.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user