
- Set up FastAPI application with CORS middleware - Implement SQLite database with SQLAlchemy ORM - Create user model and schemas for data validation - Set up Alembic for database migrations - Add comprehensive CRUD endpoints for user management - Include health check and service info endpoints - Configure automatic API documentation - Update README with complete project documentation
24 lines
492 B
Python
24 lines
492 B
Python
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
class UserBase(BaseModel):
|
|
email: str
|
|
name: str
|
|
is_active: bool = True
|
|
|
|
class UserCreate(UserBase):
|
|
pass
|
|
|
|
class UserUpdate(BaseModel):
|
|
email: Optional[str] = None
|
|
name: Optional[str] = None
|
|
is_active: Optional[bool] = None
|
|
|
|
class User(UserBase):
|
|
id: int
|
|
created_at: datetime
|
|
updated_at: Optional[datetime] = None
|
|
|
|
class Config:
|
|
from_attributes = True |