chore: init pomix camera simulator
This commit is contained in:
25
main.py
Normal file
25
main.py
Normal file
@@ -0,0 +1,25 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user