细节优化——1
This commit is contained in:
@@ -6,6 +6,17 @@ from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
class CommentCreate(BaseModel):
|
||||
content: str = Field(min_length=1)
|
||||
quote_comment_id: uuid.UUID | None = None
|
||||
|
||||
|
||||
class CommentQuote(BaseModel):
|
||||
id: uuid.UUID
|
||||
content: str
|
||||
created_by: uuid.UUID
|
||||
created_at: datetime
|
||||
is_deleted: bool = False
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class CommentRead(BaseModel):
|
||||
@@ -13,5 +24,8 @@ class CommentRead(BaseModel):
|
||||
content: str
|
||||
created_by: uuid.UUID
|
||||
created_at: datetime
|
||||
quote_comment_id: uuid.UUID | None = None
|
||||
quote: CommentQuote | None = None
|
||||
is_deleted: bool = False
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
Reference in New Issue
Block a user