Automated Action ca5dbb9088 Add complete simple messaging app with FastAPI
- Implement user authentication with JWT tokens
- Add messaging system for sending/receiving messages
- Create SQLite database with SQLAlchemy models
- Set up Alembic for database migrations
- Add health check endpoint
- Include comprehensive API documentation
- Support user registration, login, and message management
- Enable conversation history and user listing
2025-06-26 16:07:21 +00:00

20 lines
418 B
Python

from pydantic import BaseModel
from datetime import datetime
from typing import Optional
class MessageBase(BaseModel):
content: str
class MessageCreate(MessageBase):
receiver_id: int
class Message(MessageBase):
id: int
sender_id: int
receiver_id: int
created_at: datetime
sender: Optional[dict] = None
receiver: Optional[dict] = None
class Config:
from_attributes = True