Automated Action 02cc12cad8 Add FastAPI REST API service with CRUD operations
- Created main FastAPI application with CORS middleware
- Added SQLite database configuration with SQLAlchemy
- Implemented Items model with create, read, update, delete operations
- Set up Alembic migrations for database schema management
- Added comprehensive API endpoints at /api/v1/items/
- Included health check endpoint at /health
- Added proper Pydantic schemas for request/response validation
- Updated README with complete documentation and usage instructions
- Configured Ruff for code linting and formatting
2025-06-20 10:55:10 +00:00

27 lines
462 B
Python

from pydantic import BaseModel
from datetime import datetime
from typing import Optional
class ItemBase(BaseModel):
name: str
description: Optional[str] = None
class ItemCreate(ItemBase):
pass
class ItemUpdate(BaseModel):
name: Optional[str] = None
description: Optional[str] = None
class Item(ItemBase):
id: int
created_at: datetime
updated_at: Optional[datetime] = None
class Config:
from_attributes = True