POST /api/friends/request
| 字段 | 类型 | 说明 |
|---|---|---|
username | string | 要添加的用户名 |
const request = await client.sendFriendRequest('bob')request = client.send_friend_request("bob")POST /api/friends/:id/accept
const friendship = await client.acceptFriendRequest('request-id')friendship = client.accept_friend_request("request-id")POST /api/friends/:id/reject
const result = await client.rejectFriendRequest('request-id')result = client.reject_friend_request("request-id")DELETE /api/friends/:id
await client.removeFriend('friendship-id')client.remove_friend("friendship-id")GET /api/friends
const friends = await client.listFriends()friends = client.list_friends()GET /api/friends/pending
返回当前用户收到的尚未接受/拒绝的好友请求。
const pending = await client.listPendingFriendRequests()pending = client.list_pending_friend_requests()GET /api/friends/sent
const sent = await client.listSentFriendRequests()sent = client.list_sent_friend_requests()