26 lines
618 B
Python
26 lines
618 B
Python
from fastapi import FastAPI
|
|
from pydantic import BaseModel
|
|
import httpx
|
|
|
|
|
|
class InputGate(BaseModel):
|
|
cameraCode: str
|
|
plateNumber: str
|
|
plateType: str
|
|
gateName: str
|
|
gateType: str
|
|
gateLine: str
|
|
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.post("/api/v1/pomix-camera/")
|
|
async def input_gate(data: InputGate):
|
|
POMIX_CAMERA_URL: str = "http://localhost:3030/sendplateNumber"
|
|
payload = data.model_dump()
|
|
async with httpx.AsyncClient() as client:
|
|
response = await client.post(url=POMIX_CAMERA_URL, json=payload)
|
|
# Return the JSON response from the other service
|
|
return response.json()
|