Сделал скелет того, как примерно будет реализован сервис
This commit is contained in:
12
app/api/v1/endpoints/youtube.py
Normal file
12
app/api/v1/endpoints/youtube.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from fastapi import APIRouter
|
||||
from app.services import YouTubeService
|
||||
from app.schemas import DownloadResponse
|
||||
from app.schemas import DownloadRequest
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.post("/", response_model=DownloadResponse)
|
||||
async def download_video(data: DownloadRequest):
|
||||
response_data = YouTubeService.download(data)
|
||||
return response_data
|
||||
@@ -0,0 +1,8 @@
|
||||
from fastapi import APIRouter
|
||||
from app.api.v1.endpoints import youtube
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
router.include_router(youtube.router, prefix="/youtube", tags=["YouTube"])
|
||||
|
||||
Reference in New Issue
Block a user