High priority: - Fix concurrent race condition for view_count/like_count (atomic update) - Add route request ID tracking to prevent race conditions - Filter get_joke by status=approved (no pending content leak) - Add error feedback for like button Performance: - Optimize random joke query (avoid full table sort) - Limit page_size max to 100 (DoS prevention) Medium: - Add localStorage quota error handling - Handle empty AI response gracefully - Fix generate content title extraction Low: - Add rejected_jokes to stats API - Update dashboard to show rejected count
13 lines
433 B
Python
13 lines
433 B
Python
from sqlalchemy import Column, Integer, String, Text, DateTime
|
|
from sqlalchemy.sql import func
|
|
|
|
from app.database import Base
|
|
|
|
|
|
class Feedback(Base):
|
|
__tablename__ = "feedbacks"
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
name = Column(String(50), nullable=True)
|
|
email = Column(String(100), nullable=True)
|
|
content = Column(Text, nullable=False)
|
|
created_at = Column(DateTime, default=func.now()) |