Untitled

 avatar
unknown
python
2 years ago
562 B
11
Indexable
from fastapi import APIRouter, Depends
from routes import fastapi_users
from models import User


router = APIRouter()
fastapi_users = await fastapi_users()


@router.post("/endpoint_1")
async def endpoint_1(user: User = Depends(fastapi_users.current_user(active=True))):
    .......


@router.get("/endpoint_2")
async def endpoint_2(user: User = Depends(fastapi_users.current_user(active=True))):
    ........


@router.patch("/endpoint_3")
async def endpoint_3(user: User = Depends(fastapi_users.current_user(active=True))):
    ........