Archived
ADD First stage routes
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
|||||||
|
from fastapi import FastAPI
|
||||||
|
from routes import admin, auth, review, stats
|
||||||
|
|
||||||
|
app = FastAPI()
|
||||||
|
|
||||||
|
app.include_router(auth.router)
|
||||||
|
app.include_router(admin.router)
|
||||||
|
app.include_router(review.router)
|
||||||
|
app.include_router(stats.router)
|
||||||
|
|
||||||
|
@app.get("/")
|
||||||
|
def read_root():
|
||||||
|
return {"Hello": "World"}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
from fastapi import APIRouter
|
||||||
|
from models.contest import ContestBase
|
||||||
|
from models.song import SongIn
|
||||||
|
from models.user import UserCreate
|
||||||
|
|
||||||
|
router = APIRouter(
|
||||||
|
prefix="/admin",
|
||||||
|
tags=["admin"],
|
||||||
|
)
|
||||||
|
|
||||||
|
@router.post("/users")
|
||||||
|
def create_user(user: UserCreate):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@router.post("/contests")
|
||||||
|
def create_contest(contest: ContestBase):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@router.post("/songs")
|
||||||
|
def create_song(song: SongIn):
|
||||||
|
pass
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
from fastapi import APIRouter
|
||||||
|
from models.user import UserIn
|
||||||
|
|
||||||
|
router = APIRouter(
|
||||||
|
prefix="/auth",
|
||||||
|
tags=["auth"],
|
||||||
|
)
|
||||||
|
|
||||||
|
@router.post("/login")
|
||||||
|
def login(user: UserIn):
|
||||||
|
pass
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
from fastapi import APIRouter
|
||||||
|
from models.song import SongReview
|
||||||
|
|
||||||
|
router = APIRouter(
|
||||||
|
prefix="/review",
|
||||||
|
tags=["review"],
|
||||||
|
)
|
||||||
|
|
||||||
|
@router.post("")
|
||||||
|
def create_review(review: SongReview):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@router.patch("")
|
||||||
|
def update_review(review: SongReview):
|
||||||
|
pass
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
from fastapi import APIRouter
|
||||||
|
from uuid import uuid4
|
||||||
|
from typing import Union
|
||||||
|
|
||||||
|
router = APIRouter(
|
||||||
|
prefix="/stats",
|
||||||
|
tags=["stats"],
|
||||||
|
)
|
||||||
|
|
||||||
|
@router.get("/{contest_id}")
|
||||||
|
def get_stats(contest_id: uuid4, group_id: Union[uuid4, None] = None):
|
||||||
|
pass
|
||||||
|
|
||||||
Reference in New Issue
Block a user