Upload files to "frontend/routes"
This commit is contained in:
parent
d009e0da62
commit
57ee7f3419
5 changed files with 153 additions and 0 deletions
19
frontend/routes/crop.py
Normal file
19
frontend/routes/crop.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
from fastapi import APIRouter, Request
|
||||
from fastapi.responses import JSONResponse
|
||||
from pydantic import BaseModel
|
||||
import api_client
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
class CropPayload(BaseModel):
|
||||
matrix: list[float]
|
||||
scale: list[float]
|
||||
subset_name: str = ""
|
||||
|
||||
|
||||
@router.post("/crop/{pc_id}")
|
||||
async def crop(pc_id: str, payload: CropPayload):
|
||||
"""Proxifie la requête de clipping vers le backend FastAPI."""
|
||||
result = await api_client.crop_pointcloud(pc_id, payload.model_dump())
|
||||
return JSONResponse(result)
|
||||
Loading…
Add table
Add a link
Reference in a new issue