新增评论通知功能:MCP工具 + REST端点 + 前端通知面板
- 新增 xhs_get_comment_notifications / xhs_reply_notification MCP工具 - 通知获取前先读取首页未读小红点数字,无未读则直接返回空,避免重复处理 - 新增 REST 端点 GET /notifications/comments 和 POST /notifications/reply - 前端小红书页面新增「通知」按钮和 NotificationPanel slide-over 组件 - 通知面板支持查看评论通知列表和行内回复
This commit is contained in:
@@ -11,6 +11,7 @@ import type {
|
||||
ApiResponse,
|
||||
PublishResult,
|
||||
CommentResult,
|
||||
CommentNotification,
|
||||
} from './types';
|
||||
|
||||
// Health (no auth required)
|
||||
@@ -112,6 +113,20 @@ export const replyComment = (data: {
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
|
||||
// Notifications
|
||||
export const getCommentNotifications = (maxCount = 20) =>
|
||||
apiFetch<ApiResponse<CommentNotification[]>>(`/api/xhs/notifications/comments?max_count=${maxCount}`);
|
||||
|
||||
export const replyNotification = (data: {
|
||||
user_id: string;
|
||||
comment_content: string;
|
||||
reply_content: string;
|
||||
}) =>
|
||||
apiFetch<ApiResponse<CommentResult>>('/api/xhs/notifications/reply', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
|
||||
export const toggleLike = (feedId: string, xsecToken: string) =>
|
||||
apiFetch<ApiResponse<{ success: boolean; liked: boolean }>>('/api/xhs/like', {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user