
- Setup project structure and basic FastAPI application - Define database models for users, profiles, matches, and messages - Set up database connection and create Alembic migrations - Implement user authentication and registration endpoints - Create API endpoints for profile management, matches, and messaging - Add filtering and search functionality for tech profiles - Setup environment variable configuration - Create README with project information and setup instructions
40 lines
734 B
Python
40 lines
734 B
Python
from pydantic import BaseModel, Field
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
|
|
|
|
class MessageBase(BaseModel):
|
|
match_id: Optional[int] = None
|
|
content: Optional[str] = None
|
|
is_read: Optional[bool] = False
|
|
|
|
|
|
class MessageCreate(MessageBase):
|
|
match_id: int
|
|
content: str = Field(..., min_length=1)
|
|
|
|
|
|
class MessageUpdate(MessageBase):
|
|
is_read: bool = True
|
|
|
|
|
|
class MessageInDBBase(MessageBase):
|
|
id: int
|
|
match_id: int
|
|
sender_id: int
|
|
receiver_id: int
|
|
content: str
|
|
is_read: bool
|
|
created_at: datetime
|
|
updated_at: Optional[datetime] = None
|
|
|
|
class Config:
|
|
orm_mode = True
|
|
|
|
|
|
class Message(MessageInDBBase):
|
|
pass
|
|
|
|
|
|
class MessageInDB(MessageInDBBase):
|
|
pass |