Files
mctf/dark-tariff/backend/app/api/routes/readings.py
T
TakuyaYagam1 13f936bee9 chore: import MCTF services
- Added all seven issued service trees without omissions.
- Preserved the supplied runtime configuration, binaries, and assets.
2026-11-29 12:25:29 +03:00

23 lines
672 B
Python
Executable File

from fastapi import APIRouter
from backend.app.db import operations
from backend.app.api.schemas import ReadingIn
router = APIRouter(prefix="/api", tags=["readings"])
@router.get("/resources")
async def resources():
return await operations.resources()
@router.get("/readings")
async def readings():
return await operations.readings()
@router.get("/readings/{reading_id}")
async def reading_public(reading_id: int):
return await operations.reading_public(reading_id)
@router.post("/readings", status_code=201)
async def reading_add(body: ReadingIn):
return await operations.add_reading(body.serial, body.kind, body.model_dump(mode="json")["metrics"])