20 lines
549 B
Python
20 lines
549 B
Python
# Entity: Car
|
|
|
|
from fastapi import APIRouter, status
|
|
from typing import List
|
|
|
|
from core.models.car import Car
|
|
from core.schemas.car import CarSchema
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/cars", status_code=status.HTTP_200_OK, response_model=List[CarSchema])
|
|
def get_german_cars():
|
|
german_cars = [
|
|
Car(make="Volkswagen", model="Golf"),
|
|
Car(make="BMW", model="3 Series"),
|
|
Car(make="Mercedes-Benz", model="C-Class"),
|
|
Car(make="Audi", model="A4"),
|
|
Car(make="Porsche", model="911"),
|
|
]
|
|
return german_cars |