TASK-001: Setup FastAPI project structure
- Fixed main.py to include all route routers (posts, users, comments, feed) - Renamed app/models.py to app/schemas.py and split into proper schema modules - Fixed schema imports in routes - Updated app/models/__init__.py to properly export SQLAlchemy models - Fixed database imports in route files - App imports and runs correctly
This commit is contained in:
20
app/schemas/user.py
Normal file
20
app/schemas/user.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""User schemas for SocialPhoto API."""
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
class UserBase(BaseModel):
|
||||
"""Base user model."""
|
||||
username: str
|
||||
email: str
|
||||
avatar_url: Optional[str] = "/static/default-avatar.png"
|
||||
bio: Optional[str] = ""
|
||||
|
||||
|
||||
class UserStats(BaseModel):
|
||||
"""User statistics model."""
|
||||
posts_count: int
|
||||
followers_count: int
|
||||
following_count: int
|
||||
Reference in New Issue
Block a user