18 lines
519 B
Python
18 lines
519 B
Python
# Entity: Football
|
|
|
|
from fastapi import APIRouter, Depends, HTTPException, status
|
|
from sqlalchemy.orm import Session
|
|
from typing import List
|
|
from core.database import get_db
|
|
from models.football import Football
|
|
from schemas.football import FootballSchema
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/football", status_code=200, response_model=List[FootballSchema])
|
|
async def get_football(
|
|
db: Session = Depends(get_db)
|
|
):
|
|
"""Get all football data"""
|
|
football_data = db.query(Football).all()
|
|
return football_data |