54 lines
953 B
Protocol Buffer
54 lines
953 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
package movie.v1;
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
service MovieService {
|
|
rpc ListMovies (ListMovieRequest) returns (ListMovieResponse);
|
|
rpc GetMovie (GetMovieRequest) returns (GetMovieResponse);
|
|
}
|
|
|
|
message ListMovieRequest {
|
|
string category = 1;
|
|
bool random = 2;
|
|
int32 limit = 3
|
|
}
|
|
|
|
message ListMovieResponse {
|
|
repeated Movie movies = 1;
|
|
}
|
|
|
|
message GetMovieRequest {
|
|
oneof key {
|
|
string id = 1;
|
|
string slug = 2;
|
|
}
|
|
}
|
|
|
|
message GetMovieResponse {
|
|
MovieDetails movie = 1;
|
|
}
|
|
|
|
|
|
message Movie {
|
|
string id = 1;
|
|
string title = 2;
|
|
string slug = 3;
|
|
string poster = 4;
|
|
string rating_age = 5;
|
|
google.protobuf.Timestamp timestamp = 6;
|
|
}
|
|
|
|
message MovieDetails {
|
|
string id = 1;
|
|
string title = 2;
|
|
string slug = 3;
|
|
string description = 4;
|
|
string poster = 5;
|
|
string banner = 6;
|
|
int32 duration = 7;
|
|
string rating_age = 8;
|
|
string country = 9;
|
|
google.protobuf.Timestamp timestamp = 10;
|
|
}
|