Initial project commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from app.schemas.user import UserInfo
|
||||
|
||||
|
||||
class CommentCreate(BaseModel):
|
||||
content: str = Field(..., min_length=1, max_length=500)
|
||||
parent_id: int | None = None
|
||||
|
||||
|
||||
class CommentOut(BaseModel):
|
||||
id: int
|
||||
spot_id: int
|
||||
user: UserInfo | None = None
|
||||
parent_id: int | None = None
|
||||
content: str
|
||||
created_at: datetime | None = None
|
||||
replies: list["CommentOut"] = []
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class ReportCreate(BaseModel):
|
||||
reason: str = Field(..., min_length=1, max_length=500)
|
||||
Reference in New Issue
Block a user