REST API for managing personal bookmarks (title, link, category). PostgreSQL database with async SQLAlchemy, containerized with Docker Compose. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
25 lines
442 B
Python
25 lines
442 B
Python
import uuid
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class BookmarkCreate(BaseModel):
|
|
title: str
|
|
link: str
|
|
|
|
|
|
class BookmarkUpdate(BaseModel):
|
|
title: str | None = None
|
|
link: str | None = None
|
|
category: str | None = None
|
|
|
|
|
|
class BookmarkResponse(BaseModel):
|
|
id: uuid.UUID
|
|
title: str
|
|
link: str
|
|
category: str | None
|
|
created_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|