syntax = "proto3"; package proto; option go_package = ".;proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/empty.proto"; service ClipService { // Клипы rpc CreateClip(CreateClipRequest) returns (CreateClipResponse); rpc GetClip(GetClipRequest) returns (GetClipResponse); rpc GetUserClips(GetUserClipsRequest) returns (GetUserClipsResponse); rpc GetClips(GetClipsRequest) returns (GetClipsResponse); rpc DeleteClip(DeleteClipRequest) returns (google.protobuf.Empty); // Лайки rpc LikeClip(LikeClipRequest) returns (LikeClipResponse); rpc UnlikeClip(UnlikeClipRequest) returns (google.protobuf.Empty); rpc GetClipLikes(GetClipLikesRequest) returns (GetClipLikesResponse); rpc CheckIfLiked(CheckIfLikedRequest) returns (CheckIfLikedResponse); // Комментарии rpc CreateComment(CreateCommentRequest) returns (CreateCommentResponse); rpc GetClipComments(GetClipCommentsRequest) returns (GetClipCommentsResponse); rpc DeleteComment(DeleteCommentRequest) returns (google.protobuf.Empty); } message CreateClipRequest { int32 user_id = 1; string title = 2; bytes video_data = 3; string file_name = 4; string content_type = 5; } message CreateClipResponse { Clip clip = 1; } message GetClipRequest { int32 clip_id = 1; } message GetClipResponse { Clip clip = 1; } message GetUserClipsRequest { int32 user_id = 1; int32 limit = 2; int32 offset = 3; } message GetUserClipsResponse { repeated Clip clips = 1; int32 total_count = 2; } message GetClipsRequest { int32 limit = 1; int32 offset = 2; } message GetClipsResponse { repeated Clip clips = 1; int32 total_count = 2; } message DeleteClipRequest { int32 clip_id = 1; int32 user_id = 2; } message LikeClipRequest { int32 clip_id = 1; int32 user_id = 2; } message LikeClipResponse { ClipLike like = 1; } message UnlikeClipRequest { int32 clip_id = 1; int32 user_id = 2; } message GetClipLikesRequest { int32 clip_id = 1; int32 limit = 2; int32 offset = 3; } message GetClipLikesResponse { repeated ClipLike likes = 1; int32 total_count = 2; } message CheckIfLikedRequest { int32 clip_id = 1; int32 user_id = 2; } message CheckIfLikedResponse { bool is_liked = 1; } message CreateCommentRequest { int32 clip_id = 1; int32 user_id = 2; string content = 3; } message CreateCommentResponse { ClipComment comment = 1; } message GetClipCommentsRequest { int32 clip_id = 1; int32 limit = 2; int32 offset = 3; } message GetClipCommentsResponse { repeated ClipComment comments = 1; int32 total_count = 2; } message DeleteCommentRequest { int32 comment_id = 1; int32 user_id = 2; } message Clip { int32 id = 1; string title = 2; string video_url = 3; string thumbnail_url = 4; int32 duration = 5; int32 author_id = 6; int32 likes_count = 7; int32 comments_count = 8; google.protobuf.Timestamp created_at = 9; google.protobuf.Timestamp updated_at = 10; } message ClipLike { int32 id = 1; int32 clip_id = 2; int32 user_id = 3; google.protobuf.Timestamp created_at = 4; } message ClipComment { int32 id = 1; int32 clip_id = 2; int32 author_id = 3; string content = 4; google.protobuf.Timestamp created_at = 5; google.protobuf.Timestamp updated_at = 6; }