Public Access
32 lines
1.0 KiB
Python
32 lines
1.0 KiB
Python
"""Retired direct third-party recipe search and publication endpoints."""
|
|
from fastapi import APIRouter, Depends, HTTPException, Query, status
|
|
|
|
from app.schemas import RecipeImportRequest
|
|
from app.security import require_session
|
|
|
|
|
|
router = APIRouter()
|
|
_RETIRED_DETAIL = (
|
|
"Direct external recipe ingestion is retired; recipes must be staged and "
|
|
"approved through the admin import queue."
|
|
)
|
|
|
|
|
|
@router.get("/search")
|
|
def search_recipes(
|
|
q: str = Query(..., min_length=1, max_length=200),
|
|
limit: int = Query(10, ge=1, le=25),
|
|
_user: str = Depends(require_session),
|
|
):
|
|
"""Reject the legacy Spoonacular search flow without contacting a vendor."""
|
|
raise HTTPException(status_code=status.HTTP_410_GONE, detail=_RETIRED_DETAIL)
|
|
|
|
|
|
@router.post("/import")
|
|
def import_recipe(
|
|
payload: RecipeImportRequest,
|
|
_user: str = Depends(require_session),
|
|
):
|
|
"""Reject direct publication; reviewed staging is the sole import path."""
|
|
raise HTTPException(status_code=status.HTTP_410_GONE, detail=_RETIRED_DETAIL)
|