status_timestamp.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. from datetime import datetime
  2. from pydantic.main import BaseModel
  3. class BlowyFeedbackTimeBase(BaseModel):
  4. timestamp: datetime | None
  5. device_id: str | None
  6. class BlowyFeedbackTimeCreate(BlowyFeedbackTimeBase):
  7. timestamp: datetime
  8. device_id: str
  9. class BlowyFeedbackTimeUpdate(BlowyFeedbackTimeBase):
  10. timestamp: datetime
  11. device_id: str
  12. class BlowyFeedbackTimeInDBBase(BlowyFeedbackTimeBase):
  13. id: int
  14. class Config:
  15. orm_mode = True
  16. class BlowyFeedbackTime(BlowyFeedbackTimeInDBBase):
  17. pass
  18. class BlowyFeedbackTimeInDB(BlowyFeedbackTimeInDBBase):
  19. pass
  20. class HighSpeedTimeBase(BaseModel):
  21. timestamp: datetime | None
  22. device_id: str | None
  23. class HighSpeedTimeCreate(HighSpeedTimeBase):
  24. timestamp: datetime
  25. device_id: str
  26. class HighSpeedTimeUpdate(HighSpeedTimeBase):
  27. timestamp: datetime
  28. device_id: str
  29. class HighSpeedTimeInDBBase(HighSpeedTimeBase):
  30. id: int
  31. class Config:
  32. orm_mode = True
  33. class HighSpeedTime(HighSpeedTimeInDBBase):
  34. pass
  35. class HighSpeedTimeInDB(HighSpeedTimeInDBBase):
  36. pass