feat: Add comment system and outlets data to News API
- 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>
This commit is contained in:
22
services/news-api/backend/app/models/comment.py
Normal file
22
services/news-api/backend/app/models/comment.py
Normal file
@ -0,0 +1,22 @@
|
||||
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
|
||||
Reference in New Issue
Block a user