Prepis strankovani na extension, sjednoceni volani resolveru

This commit is contained in:
Michal Kváček
2025-03-05 13:23:38 +01:00
parent c6316262e5
commit 77c9242944
47 changed files with 532 additions and 606 deletions
+36
View File
@@ -0,0 +1,36 @@
from fastapi import APIRouter
from endpoints.photo_editor_preview import PhotoEditorEndpoint
from jwt import access_security, refresh_security
router = APIRouter()
@router.get("/photo/editor-preview/{photo_id}", summary="Photo editor preview")
async def photo_editor_preview(
photo_id: int,
brightness: float | None = None,
contrast: float | None = None,
saturation: float | None = None,
sharpness: float | None = None,
rotate: float | None = None,
crop_left: float | None = None,
crop_top: float | None = None,
crop_width: float | None = None,
crop_height: float | None = None,
):
return await PhotoEditorEndpoint(
access_token=access_security,
refresh_token=refresh_security
).show_preview(
photo_id=photo_id,
logged_user_id=0,
saturation=saturation,
brightness=brightness,
contrast=contrast,
sharpness=sharpness,
crop_top=crop_top,
crop_left=crop_left,
crop_height=crop_height,
crop_width=crop_width,
rotate=rotate,
)