This commit is contained in:
lightings 2023-07-24 14:26:33 +08:00
parent b821c368f8
commit 60a608335c
2 changed files with 54 additions and 4 deletions

View File

@ -265,9 +265,32 @@ class FriendHandler {
* { * {
* "code": 200, * "code": 200,
* "friendRequests": [ * "friendRequests": [
* { * {
* "account_id": "5f9f5b9b0b5c4b0b8c8c0b5c", "idx":10003,
* } "account_id":"6516_2006_0xef59f6cc4d190a0ae576c46d4583e92b61174340",
"name":"iij",
"sex":0,
"head_id":50006,
"head_frame":60000,
"level":1,
"bceg":0,
"gold":18588,
"diamond":10000,
"rank":1,
"ring_id":0,
"last_login_time":1670490960,
"online":1,
"guildInfo":{
"idx":22,
"gname":"Guild2",
"logo":null,
"gowner":"6516_2006_0xef59f6cc4d190a0ae576c46d4583e92b61174340",
"gownername":"iij",
"gmaxmember":100,
"announce":null,
"countmember":1
}
* }
* ] * ]
* } * }
* *
@ -277,6 +300,33 @@ class FriendHandler {
* "msg": "Failed to get pending friend requests." * "msg": "Failed to get pending friend requests."
* } * }
*/ */
{
"idx":10003,
"account_id":"6516_2006_0xef59f6cc4d190a0ae576c46d4583e92b61174340",
"name":"iij",
"sex":0,
"head_id":50006,
"head_frame":60000,
"level":1,
"bceg":0,
"gold":18588,
"diamond":10000,
"rank":1,
"ring_id":0,
"last_login_time":1670490960,
"online":1,
"guildInfo":{
"idx":22,
"gname":"Guild2",
"logo":null,
"gowner":"6516_2006_0xef59f6cc4d190a0ae576c46d4583e92b61174340",
"gownername":"iij",
"gmaxmember":100,
"announce":null,
"countmember":1
}
}
async getPendingFriendRequests(msg, { uid }, next) { async getPendingFriendRequests(msg, { uid }, next) {
try { try {
const friendRequests = await this.friendService.getPendingFriendRequests( const friendRequests = await this.friendService.getPendingFriendRequests(

View File

@ -86,7 +86,7 @@ describe("add friend", () => {
test ("list friend invites", async () => { test ("list friend invites", async () => {
msg = await tbc.rpc("friend.friendHandler.getPendingFriendInvitations", {}); msg = await tbc.rpc("friend.friendHandler.getPendingFriendInvitations", {});
console.log(msg); console.log(JSON.stringify(msg));
expect(msg.code).toBe(200); expect(msg.code).toBe(200);
}); });