
- 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
20 lines
418 B
Python
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 |