This commit is contained in:
Bedir Tuğra Karaabalı 2025-05-05 15:02:44 +03:00
parent 7281477269
commit 8cefa60d3a
6 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1 @@

View File

View File

12
items/models.py Normal file
View File

@ -0,0 +1,12 @@
from datetime import datetime, timedelta, timezone
from ..auth.models import UserInDb
class UserProfile(UserInDb):
bio : str | None = None
created_date : datetime | None = None
collections : list[str] | None = None
items :list[str] | None = None

18
items/router.py Normal file
View File

@ -0,0 +1,18 @@
from .models import UserProfile
from fastapi import APIRouter, Depends
from typing import Annotated
from ..auth.models import get_current_active_user
router = APIRouter(
prefix="/items",
tags=["items"],
responses={404: {"description": "Not found"}},
dependencies=[],
)
@router.get('/profile', response_model=UserProfile)
async def get_user_profile(
current_user: Annotated[UserProfile, Depends(get_current_active_user)]
) -> UserProfile:
return current_user

View File

@ -1,8 +1,9 @@
from .config import app
from .auth.router import router as auth_router
from .items.router import router as items_router
app.include_router(auth_router)
app.include_router(items_router)
'''
from fastapi import FastAPI