- Add comment models and service with CRUD operations - Add comment endpoints (GET, POST, count) - Add outlets-extracted.json with people/topics/companies data - Fix database connection in comment_service to use centralized get_database() 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
23 lines
414 B
Python
23 lines
414 B
Python
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
|