-
Notifications
You must be signed in to change notification settings - Fork 0
RPC Requirements
PCBZ edited this page Nov 6, 2025
·
11 revisions
Retrieves basic user information (username) for a list of user IDs. Used by Social Graph Service to enrich follower/following lists with usernames.
POST /user-service/batchGetUserInfo
message BatchGetUserInfoRequest {
repeated int64 user_ids = 1; // Required: List of user IDs to retrieve (Max: 100)
}message BatchGetUserInfoResponse {
map users = 1; // Map of user_id to user information
repeated int64 not_found = 2; // List of user IDs that were not found
string error_code = 3; // Error code if request failed
string error_message = 4; // Error message if request failed
}
message UserInfo {
int64 user_id = 1; // User ID
string username = 2; // Username
}{
"users": {
"101": {
"user_id": 101,
"username": "alice_smith"
},
"102": {
"user_id": 102,
"username": "bob_jones"
},
"103": {
"user_id": 103,
"username": "charlie_brown"
}
},
"not_found": [999],
"error_code": "",
"error_message": ""
}Retrieves the list of users that a specified user follows, with optional filtering by minimum follower count and result limiting.
POST /social-graph/getFollowing
message GetFollowingRequest {
int64 user_id = 1; // Required: ID of the user whose following list to retrieve
int32 min_followers = 2; // Optional: Minimum follower count filter (default: 0)
int32 limit = 3; // Optional: Maximum number of users to return (default: 1000)
}message GetFollowingResponse {
repeated int64 user_ids = 1; // List of user IDs that the user follows
int32 total_count = 2; // Total count before limit applied
bool has_more = 3; // Whether there are more results available
string error_message = 4; // Error message if request failed
}Retrieves the list of users who follow a specified user, used for fan-out operations when a post is created.
POST /social-graph/getFollowers
message GetFollowersRequest {
int64 user_id = 1; // Required: ID of the user whose followers to retrieve
int32 limit = 2; // Optional: Maximum number of followers to return (default: 1000)
int32 offset = 3; // Optional: Pagination offset (default: 0)
}message GetFollowersResponse {
repeated int64 user_ids = 1; // List of follower user IDs
int32 total_count = 2; // Total follower count before pagination
bool has_more = 3; // Whether there are more results available
string error_message = 4; // Error message if request failed
}Retrieves the follower count for a specified user.
POST /social-graph/getFollowersCount
message GetFollowersCountRequest {
int64 user_id = 1; // Required: ID of the user whose follower count to retrieve
}message GetFollowersCountResponse {
int64 user_id = 1; // User ID from the request
int32 followers_count = 2; // Number of followers this user has
string error_message = 3; // Error message if request failed
}Efficiently retrieves recent posts from multiple users in a single batch request, optimized for timeline generation.
POST /post-service/batchGetPosts
message BatchGetPostsRequest {
repeated int64 user_ids = 1; // Required: List of user IDs whose posts to retrieve
int32 limit = 2; // Optional: Maximum posts per user (default: 50)
}message BatchGetPostsResponse {
map<int64, repeated Post> user_posts = 1;
string error_message = 2;
}
message Post {
int64 post_id = 1;
int64 user_id = 2;
string content = 3;
int64 timestamp = 4;
}