Automated Action f1784ca3da Create REST API service with FastAPI and SQLite
- 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
2025-06-26 01:43:42 +00:00

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