from pydantic import BaseModel, Field from typing import Optional from datetime import datetime class CommentBase(BaseModel): articleId: str nickname: str content: str class CommentCreate(CommentBase): pass class Comment(CommentBase): id: str createdAt: datetime class Config: from_attributes = True class CommentList(BaseModel): comments: list[Comment] total: int