23. gRPCサービスの定義
(./lib/killrvideo-service-protos/src 以下)
// Manages comments
service CommentsService {
// Add a new comment to a video
rpc CommentOnVideo(CommentOnVideoRequest) returns (CommentOnVideoResponse);
// Get comments made by a user
rpc GetUserComments(GetUserCommentsRequest) returns (GetUserCommentsResponse);
// Get comments made on a video
rpc GetVideoComments(GetVideoCommentsRequest) returns (GetVideoCommentsResponse);
}
23
24. gRPCサービスの定義
(./lib/killrvideo-service-protos/src 以下)
// Get a page of comments made by a specific user
message GetUserCommentsRequest {
killrvideo.common.Uuid user_id = 1;
int32 page_size = 2;
killrvideo.common.TimeUuid starting_comment_id = 3;
string paging_state = 16;
}
// Response when getting a page of comments made by a user
message GetUserCommentsResponse {
killrvideo.common.Uuid user_id = 1;
repeated UserComment comments = 2;
string paging_state = 3;
}
24