Add ServerTime schema

This commit is contained in:
Backend IM Bot 2025-03-26 17:03:15 +00:00
parent 728611188b
commit f9e059e51d

17
schemas/servertime.py Normal file
View 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"
}
}