initial commit for GitHub
This commit is contained in:
0
server/app/routers/__init__.py
Normal file
0
server/app/routers/__init__.py
Normal file
20
server/app/routers/albums.py
Normal file
20
server/app/routers/albums.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app.controller import controller
|
||||
from app.model import Album
|
||||
|
||||
router = APIRouter(
|
||||
prefix="/albums",
|
||||
tags=["albums"],
|
||||
responses={404: {"description": "Not found"}},
|
||||
)
|
||||
|
||||
|
||||
@router.get("/")
|
||||
async def all_albums() -> list[Album]:
|
||||
return await controller.get_all_albums()
|
||||
|
||||
|
||||
@router.get("/{album_id}")
|
||||
async def album(album_id: int) -> Album:
|
||||
return controller.get_one_album(album_id)
|
||||
20
server/app/routers/artwork.py
Normal file
20
server/app/routers/artwork.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app.controller import controller
|
||||
from app.model import Artwork
|
||||
|
||||
router = APIRouter(
|
||||
prefix="/artwork",
|
||||
tags=["artwork"],
|
||||
responses={404: {"description": "Not found"}},
|
||||
)
|
||||
|
||||
|
||||
@router.get("/")
|
||||
async def all_artwork() -> list[Artwork]:
|
||||
return await controller.get_all_artwork()
|
||||
|
||||
|
||||
@router.get("/{artwork_id}")
|
||||
async def artwork(artwork_id: int) -> Artwork:
|
||||
return controller.get_one_artwork(artwork_id)
|
||||
20
server/app/routers/bio.py
Normal file
20
server/app/routers/bio.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app.controller import controller
|
||||
from app.model.bio import Bio, ProfessionalService
|
||||
|
||||
router = APIRouter(
|
||||
prefix="/bio",
|
||||
tags=["bio"],
|
||||
responses={404: {"description": "Not found"}},
|
||||
)
|
||||
|
||||
|
||||
@router.get("/")
|
||||
async def bio() -> Bio:
|
||||
return await controller.get_bio()
|
||||
|
||||
|
||||
@router.get("/services")
|
||||
async def services() -> list[ProfessionalService]:
|
||||
return await controller.get_all_professional_services()
|
||||
20
server/app/routers/quotes.py
Normal file
20
server/app/routers/quotes.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app.controller import controller
|
||||
from app.model import Quote
|
||||
|
||||
router = APIRouter(
|
||||
prefix="/quotes",
|
||||
tags=["quotes"],
|
||||
responses={404: {"description": "Not found"}},
|
||||
)
|
||||
|
||||
|
||||
@router.get("/")
|
||||
async def all_quotes() -> list[Quote]:
|
||||
return await controller.get_all_quotes()
|
||||
|
||||
|
||||
@router.get("/{id}")
|
||||
async def quote(id: int) -> Quote:
|
||||
return controller.get_one_quote(id)
|
||||
20
server/app/routers/videos.py
Normal file
20
server/app/routers/videos.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app.controller import controller
|
||||
from app.model import Video
|
||||
|
||||
router = APIRouter(
|
||||
prefix="/videos",
|
||||
tags=["videos"],
|
||||
responses={404: {"description": "Not found"}},
|
||||
)
|
||||
|
||||
|
||||
@router.get("/")
|
||||
async def all_videos() -> list[Video]:
|
||||
return await controller.get_all_videos()
|
||||
|
||||
|
||||
@router.get("/{video_id}")
|
||||
async def video(video_id: int) -> Video:
|
||||
return controller.get_one_video(video_id)
|
||||
Reference in New Issue
Block a user