2024-10-13 16:38:23 +04:00
|
|
|
from pydantic import BaseModel
|
2024-10-14 18:19:44 +04:00
|
|
|
from typing import Optional
|
2024-10-13 16:38:23 +04:00
|
|
|
|
|
|
|
class LaptopCreate(BaseModel):
|
2024-10-14 18:19:44 +04:00
|
|
|
brand: str
|
2024-10-13 16:38:23 +04:00
|
|
|
processor: str
|
|
|
|
ram: int
|
|
|
|
os: str
|
|
|
|
ssd: int
|
|
|
|
display: float
|
2024-10-14 18:19:44 +04:00
|
|
|
gpu: str
|
|
|
|
weight: float
|
|
|
|
battery_size: int
|
|
|
|
release_year: int
|
|
|
|
display_type: str
|
2024-10-13 16:38:23 +04:00
|
|
|
|
|
|
|
class LaptopResponse(BaseModel):
|
|
|
|
id: int
|
2024-10-14 18:19:44 +04:00
|
|
|
brand: str
|
2024-10-13 16:38:23 +04:00
|
|
|
processor: str
|
|
|
|
ram: int
|
|
|
|
os: str
|
|
|
|
ssd: int
|
|
|
|
display: float
|
2024-10-14 18:19:44 +04:00
|
|
|
gpu: str
|
|
|
|
weight: float
|
|
|
|
battery_size: int
|
|
|
|
release_year: int
|
|
|
|
display_type: str
|
2024-10-13 16:38:23 +04:00
|
|
|
|
|
|
|
class Config:
|
|
|
|
orm_mode = True
|
|
|
|
|
|
|
|
class PredictPriceResponse(BaseModel):
|
|
|
|
predicted_price: float
|