Initial commit - Migrated to Dev environment

This commit is contained in:
2026-02-03 19:55:45 +00:00
commit a34e5b7976
3518 changed files with 481663 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select
from app.db.session import get_db
from app.schemas.user import UserResponse
from app.models.user import User
router = APIRouter()
# Ideiglenes mock user, amíg nincs JWT auth
async def get_mock_current_user_id():
return 2 # Good Guy ID
@router.get("/me", response_model=UserResponse)
async def read_users_me(
db: AsyncSession = Depends(get_db),
user_id: int = Depends(get_mock_current_user_id)
):
"""Visszaadja a bejelentkezett felhasználó profilját (Hírnévvel!)"""
result = await db.execute(select(User).where(User.id == user_id))
user = result.scalars().first()
if not user:
raise HTTPException(status_code=404, detail="User not found")
return user