feat: add like and favorite functionality for feeds (#207)
* feat: add like and favorite functionality for feeds - Implemented handleLikeFeed and handleFavoriteFeed methods in mcp_handlers.go to manage liking and favoriting feeds. - Added LikeFavoriteArgs struct in mcp_server.go for handling parameters. - Registered new MCP tools for liking and favoriting feeds in registerTools function. - Introduced LikeFeed and FavoriteFeed methods in XiaohongshuService to interact with the respective actions. - Created LikeFavoriteAction in a new file to encapsulate the logic for liking and favoriting feeds on the Xiaohongshu platform. * "Fix-build-errors" * refactor: streamline like and favorite actions in LikeFavoriteAction - Introduced a generic method `performInteractAction` to handle both liking and favoriting feeds, reducing code duplication. - Updated logging to reflect the action type being performed (like or favorite). - Enhanced state verification after interaction to ensure accurate feedback on success or failure. - Removed the `clickLastMatch` function, simplifying the interaction logic. * "Add-unlike-and-unfavorite-functionality" * "Refactor-performInteractAction-function" * "Refactor-split-LikeFavoriteAction-into-separate-actions" --------- Co-authored-by: chekayo <9827969+chekayo@user.noreply.gitee.com>
This commit is contained in:
7
types.go
7
types.go
@@ -63,3 +63,10 @@ type UserProfileRequest struct {
|
||||
UserID string `json:"user_id" binding:"required"`
|
||||
XsecToken string `json:"xsec_token" binding:"required"`
|
||||
}
|
||||
|
||||
// ActionResult 通用动作响应(点赞/收藏等)
|
||||
type ActionResult struct {
|
||||
FeedID string `json:"feed_id"`
|
||||
Success bool `json:"success"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user