feat: 初始化工程
This commit is contained in:
31
schemas/comment.py
Normal file
31
schemas/comment.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from schemas.user import UserResponse
|
||||
|
||||
|
||||
class CommentCreate(BaseModel):
|
||||
record_id: int
|
||||
user_id: int
|
||||
content: str
|
||||
|
||||
|
||||
class CommentUpdate(BaseModel):
|
||||
content: str
|
||||
|
||||
|
||||
class CommentResponse(BaseModel):
|
||||
id: int
|
||||
record_id: int
|
||||
user: UserResponse
|
||||
content: str
|
||||
create_time: datetime
|
||||
update_time: datetime
|
||||
|
||||
model_config = {
|
||||
"from_attributes": True,
|
||||
"json_encoders": {
|
||||
datetime: lambda dt: dt.strftime("%Y-%m-%d %H:%M:%S")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user