Add ServerTime schema
This commit is contained in:
parent
728611188b
commit
f9e059e51d
17
schemas/servertime.py
Normal file
17
schemas/servertime.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
from pydantic import BaseModel, Field
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
class ServerTimeBase(BaseModel):
|
||||||
|
current_time: datetime = Field(default_factory=datetime.now, description="Current server timestamp")
|
||||||
|
|
||||||
|
class ServerTimeCreate(ServerTimeBase):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class ServerTime(ServerTimeBase):
|
||||||
|
class Config:
|
||||||
|
orm_mode = True
|
||||||
|
schema_extra = {
|
||||||
|
"example": {
|
||||||
|
"current_time": "2024-01-20T12:00:00.000Z"
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user