FastApi-ISS/schemas.py
2025-08-07 03:02:13 +03:30

25 lines
663 B
Python

from pydantic import BaseModel, Field
from typing import List, Optional
from uuid import UUID
from datetime import datetime
class ScrapeRequest(BaseModel):
username: str
seller_id: UUID
max_count: int = Field(default=5, ge=1, le=50)
class MediaItem(BaseModel):
media_type: str # "image" or "video"
url: str # ✅ only S3/MinIO URL (renamed from local_media)
class ScrapedPost(BaseModel):
ig_post_id: str
media_type: str # "image", "video", or "carousel"
caption: Optional[str]
thumbnail_url: Optional[str]
local_media: List[MediaItem] # ✅ now only contains {"media_type", "url"}
created_at: datetime