Appearance
评论互动插件提供通用的评论、点赞、收藏、举报、分享和互动统计能力。支持多目标类型(文章、帖子、快讯等),适用于所有内容模块。
comment-interaction
0.1.0
comment.created
comment.approved
like.toggled
favorite.toggled
表名: comments
comments
article
topic
pending
approved
rejected
spam
表名: likes
likes
唯一部分索引:(tenant_id, user_id, target_type, target_id) WHERE deleted_at IS NULL
(tenant_id, user_id, target_type, target_id) WHERE deleted_at IS NULL
表名: favorites — 结构与 likes 相同
favorites
表名: reports
reports
handled
dismissed
表名: shares
shares
表名: interaction_stats
interaction_stats
/api/v1/comments/:target_type/:target_id
/api/v1/comments/replies/:id
/api/v1/likes/:target_type/:target_id/count
/api/v1/favorites/:target_type/:target_id/count
/api/v1/shares/:target_type/:target_id/count
/api/v1/stats/:target_type/:target_id
/api/v1/stats/:target_type/:target_id/view
/api/v1/comments
/api/v1/comments/:id
/api/v1/comments/:id/approve
comment.moderate
/api/v1/comments/:id/reject
/api/v1/likes/:target_type/:target_id/toggle
/api/v1/likes/:target_type/:target_id/check
/api/v1/favorites/:target_type/:target_id/toggle
/api/v1/favorites/:target_type/:target_id/check
/api/v1/reports
comment.read
/api/v1/reports/:id/handle
comment.report.manage
/api/v1/shares
UserID > 0
true
false
ReplyCount
IP
UserAgent
评论互动插件
评论互动插件提供通用的评论、点赞、收藏、举报、分享和互动统计能力。支持多目标类型(文章、帖子、快讯等),适用于所有内容模块。
插件信息
comment-interaction0.1.0事件
comment.createdcomment.approvedlike.toggledfavorite.toggled数据模型
Comment(评论)
表名:
commentsarticle、topic),索引pending/approved/rejected/spamLike(点赞)
表名:
likes唯一部分索引:
(tenant_id, user_id, target_type, target_id) WHERE deleted_at IS NULLFavorite(收藏)
表名:
favorites— 结构与likes相同Report(举报)
表名:
reportspending/handled/dismissedShare(分享)
表名:
sharesInteractionStats(互动统计)
表名:
interaction_statsAPI 接口
公开接口
/api/v1/comments/:target_type/:target_id/api/v1/comments/replies/:id/api/v1/likes/:target_type/:target_id/count/api/v1/favorites/:target_type/:target_id/count/api/v1/shares/:target_type/:target_id/count/api/v1/stats/:target_type/:target_id/api/v1/stats/:target_type/:target_id/view认证接口
/api/v1/comments/api/v1/comments/:id/api/v1/comments/:id/approvecomment.moderate/api/v1/comments/:id/rejectcomment.moderate/api/v1/likes/:target_type/:target_id/toggle/api/v1/likes/:target_type/:target_id/check/api/v1/favorites/:target_type/:target_id/toggle/api/v1/favorites/:target_type/:target_id/check/api/v1/reports/api/v1/reportscomment.read/api/v1/reports/:id/handlecomment.report.manage/api/v1/shares业务规则
UserID > 0)创建的评论自动标记为approvedtrue(已操作)/false(已取消)interaction_stats表对应计数ReplyCountIP和UserAgent字段在 JSON 序列化时隐藏