From cc7b08d9f6ecd42bf85ef8010ed965c20bff281c Mon Sep 17 00:00:00 2001 From: Kevin Szuchet Date: Wed, 15 Jan 2025 17:35:48 -0300 Subject: [PATCH] feat: Add pagination data in the response of the paginated rpc calls --- .../social_service_v2/social_service.proto | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/proto/decentraland/social_service_v2/social_service.proto b/proto/decentraland/social_service_v2/social_service.proto index ebaf0f2c..b64322f6 100644 --- a/proto/decentraland/social_service_v2/social_service.proto +++ b/proto/decentraland/social_service_v2/social_service.proto @@ -79,10 +79,20 @@ message MutualFriendsPayload { optional Pagination pagination = 2; } +message PaginatedResponse { + int32 total = 1; + int32 page = 2; +} + message UsersResponse { repeated User users = 1; } +message PaginatedUserResponse { + repeated User users = 1; + PaginatedResponse pagination_data = 2; +} + message FriendshipRequestsResponse { oneof response { Requests requests = 1; @@ -90,6 +100,14 @@ message FriendshipRequestsResponse { } } +message PaginatedFriendshipRequestsResponse { + oneof response { + Requests requests = 1; + InternalServerError internal_server_error = 2; + } + optional PaginatedResponse pagination_data = 3; +} + message UpsertFriendshipResponse { message Accepted { string id = 1; @@ -161,10 +179,10 @@ service SocialService { service SocialServiceV2 { // Get the list of friends for the authenticated user - rpc GetFriends(GetFriendsPayload) returns (stream UsersResponse) {} + rpc GetFriends(GetFriendsPayload) returns (stream PaginatedUserResponse) {} // Get the list of mutual friends between the authenticated user and the one in the parameter - rpc GetMutualFriends(MutualFriendsPayload) returns (stream UsersResponse) {} + rpc GetMutualFriends(MutualFriendsPayload) returns (stream PaginatedUserResponse) {} // Get the pending friendship requests for the authenticated user rpc GetPendingFriendshipRequests(GetFriendshipRequestsPayload) returns (FriendshipRequestsResponse) {}