14 lines
351 B
Python
14 lines
351 B
Python
# Entity: Planet
|
|
|
|
from fastapi import APIRouter, Depends, HTTPException, status
|
|
from sqlalchemy.orm import Session
|
|
from app.api.db.database import get_db
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/planets", response_model=List[PlanetSchema])
|
|
async def get_planets(
|
|
db: Session = Depends(get_db)
|
|
):
|
|
planets = db.query(Planet).all()
|
|
return planets |