25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vehicle.py 618 B

123456789101112131415161718192021222324252627282930313233
  1. from typing import Optional
  2. from pydantic import BaseModel
  3. class CreateVehicle(BaseModel):
  4. Model: str
  5. Year: int
  6. LicensePlate: str
  7. Mileage: int
  8. Capacity: int
  9. class OutputVehicle(BaseModel):
  10. Id: int
  11. Model: str
  12. Year: int
  13. LicensePlate: str
  14. Mileage: int
  15. CurrentLocation: Optional[list[str]] = None
  16. Fuel: Optional[int] = 0
  17. Type: str
  18. DriverHistory: Optional[list[int]] = None
  19. AssignedDriver: Optional[int] = None
  20. Capacity: int
  21. Status: str
  22. class UpdateVehicle(OutputVehicle):
  23. pass
  24. class VehicleLocation(BaseModel):
  25. CurrentLocation: list[str]