Files
OnEverControl/backend/app/api/v1/control_posts.py
T

30 lines
1.1 KiB
Python

# ==============================================================================
# Endpoints de Puestos de Control y Workstations (/api/v1/control-posts)
# ==============================================================================
from typing import List, Dict, Any
from fastapi import APIRouter
from app.schemas.workstation_schema import WorkstationStatusResponse
from app.services.workstation_service import WorkstationService
router = APIRouter()
@router.get(
"/workstation/{name}/status",
response_model=WorkstationStatusResponse,
summary="Consultar estado y carriles asignados a una Workstation",
)
async def get_workstation_status(name: str):
"""Verifica si la tablet/estación está autorizada como Puesto de Control y retorna sus carriles."""
return WorkstationService.obtener_estado_workstation(name)
@router.get(
"/workstations",
response_model=List[Dict[str, Any]],
summary="Listar todas las Workstations registradas",
)
async def list_workstations():
"""Listado de estaciones para selector de tablets o supervisores."""
return WorkstationService.listar_estaciones_disponibles()