added gamefication
This commit is contained in:
@@ -8,6 +8,7 @@ from sqlalchemy.orm import Session
|
||||
from app.auth.deps import get_current_user
|
||||
from app.db.base import get_db
|
||||
from app.db.models import User
|
||||
from app.fitness.gamification import build_gamification
|
||||
from app.fitness.service import FitnessService
|
||||
from app.fitness.structuring import structure_meal, structure_workout
|
||||
from app.integrations.openfoodfacts import OpenFoodFactsClient
|
||||
@@ -175,6 +176,16 @@ def get_charts(
|
||||
return FitnessService(db, user.id).get_charts(weeks=weeks, trend=trend, end_day=end_day)
|
||||
|
||||
|
||||
@router.get("/fitness/gamification")
|
||||
def get_gamification(
|
||||
end: str | None = None,
|
||||
db: Session = Depends(get_db),
|
||||
user: User = Depends(get_current_user),
|
||||
) -> dict[str, Any]:
|
||||
end_day = date.fromisoformat(end) if end else None
|
||||
return build_gamification(db, user.id, end_day=end_day)
|
||||
|
||||
|
||||
@router.get("/fitness/compare")
|
||||
def compare_days(
|
||||
dates: str,
|
||||
|
||||
Reference in New Issue
Block a user