
- User authentication with JWT tokens (register/login) - Tutor session management with CRUD operations - Message tracking for tutor conversations - SQLite database with Alembic migrations - CORS configuration for frontend integration - Health check and service info endpoints - Proper project structure with models, schemas, and API routes
42 lines
874 B
Python
42 lines
874 B
Python
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
from typing import Optional, List
|
|
|
|
|
|
class TutorSessionBase(BaseModel):
|
|
subject: str
|
|
topic: Optional[str] = None
|
|
difficulty_level: Optional[str] = None
|
|
|
|
|
|
class TutorSessionCreate(TutorSessionBase):
|
|
pass
|
|
|
|
|
|
class TutorSessionUpdate(BaseModel):
|
|
subject: Optional[str] = None
|
|
topic: Optional[str] = None
|
|
difficulty_level: Optional[str] = None
|
|
session_status: Optional[str] = None
|
|
|
|
|
|
class TutorMessage(BaseModel):
|
|
id: int
|
|
message_type: str
|
|
content: str
|
|
created_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class TutorSession(TutorSessionBase):
|
|
id: int
|
|
user_id: int
|
|
session_status: str
|
|
created_at: datetime
|
|
updated_at: Optional[datetime] = None
|
|
messages: List[TutorMessage] = []
|
|
|
|
class Config:
|
|
from_attributes = True |