Skip to content

Instantly share code, notes, and snippets.

@mdwitr0
Created December 15, 2022 14:59
Show Gist options
  • Save mdwitr0/0b6929bfc06f83a90674dedf3a7e889e to your computer and use it in GitHub Desktop.
Save mdwitr0/0b6929bfc06f83a90674dedf3a7e889e to your computer and use it in GitHub Desktop.
Proto контракты для kinopoisk.dev
syntax = "proto3";
package episode;
message Episode {
uint32 number = 1;
string name = 2;
string en_name = 3;
string date = 4;
string description = 5;
}
syntax = "proto3";
package image;
import "movie.proto";
service KinoposikdevImageService {
rpc FindById(movie.Id) returns (Images);
}
message Image {
uint32 movie_id = 1;
string type = 2;
string language = 3;
string url = 4;
string preview_url = 5;
uint32 height = 6;
uint32 width = 7;
}
message Images {
repeated Image images = 1;
}
syntax = "proto3";
package movie;
service KinoposikdevMovieService {
rpc FindById(Id) returns (Movie);
}
message ExternalId {
string kp_hd = 1;
string imdb = 2;
uint32 tmdb = 3;
}
message Rating {
string kp_hd = 1;
string imdb = 2;
uint32 tmdb = 3;
}
message VendorNumbers {
uint32 kp = 1;
uint32 imdb = 2;
uint32 tmdb = 3;
uint32 film_critics = 4;
uint32 russian_film_critics = 5;
uint32 await = 6;
}
message Logo {
string url = 1;
}
message Image {
string url = 1;
string preview_url = 2;
}
message VendorImage {
string name = 1;
string url = 2;
string preview_url = 3;
}
message Name {
string name = 1;
}
message Video {
string url = 1;
string name = 2;
string site = 3;
uint32 size = 4;
string type = 5;
}
message VideoTypes {
repeated Video trailers = 1;
repeated Video teasers = 2;
}
message Person {
uint32 id = 1;
string photo = 2;
string name = 3;
string en_name = 4;
string description = 5;
string profession = 6;
string en_profession = 7;
}
message CurrencyValue {
uint32 value = 1;
string currency = 2;
}
message Fees {
CurrencyValue world = 1;
CurrencyValue russia = 2;
CurrencyValue usa = 3;
}
message Distributor {
string distributor = 1;
string distributor_release = 2;
}
message Premiere {
string country = 1;
string world = 2;
string russia = 3;
string digital = 4;
string cinema = 5;
string bluray = 6;
string dvd = 7;
}
message SpokenLanguages {
string name = 1;
string name_en = 2;
}
message Images {
uint32 posters_count = 1;
uint32 backdrops_count = 2;
uint32 frames_count = 3;
}
message Value {
string value = 1;
}
message Fact {
string value = 1;
string type = 2;
bool spoiler = 3;
}
message ReviewInfo {
uint32 count = 1;
uint32 positive_count = 2;
string percentage = 3;
}
message SeasonInfo {
uint32 number = 1;
uint32 episodes_count = 2;
}
message LinkedMovie {
uint32 id = 1;
string name = 2;
string en_name = 3;
string alternative_name = 4;
string type = 5;
Image poster = 6;
}
message Watchability {
repeated WatchabilityItem items = 1;
}
message WatchabilityItem {
string name = 1;
Logo logo = 2;
string url = 3;
}
message Technology {
bool has_imax = 1;
bool has_3d = 2;
}
message Lists {
repeated string countries = 1;
repeated string genres = 2;
repeated string directors = 3;
repeated string screenwriters = 4;
repeated string producers = 5;
repeated string operators = 6;
repeated string composers = 7;
repeated string artists = 8;
repeated string editors = 9;
repeated string actors = 10;
}
message Id {
uint32 id = 1;
}
message Movie {
uint32 id = 1;
ExternalId external_id = 2;
string name = 3;
string alternative_name = 4;
string en_name = 5;
repeated Name names = 6;
string type = 7;
uint32 type_number = 8;
string sub_type = 9;
uint32 year = 10;
string description = 11;
string short_description = 12;
string slogan = 13;
string status = 14;
repeated Fact facts = 15;
VendorNumbers rating = 16;
VendorNumbers votes = 17;
uint32 movie_length = 18;
string rating_mpaa = 19;
uint32 age_rating = 20;
Logo logo = 21;
Image poster = 22;
Image horizontal_poster = 23;
Image backdrop = 24;
Images images_info = 25;
VideoTypes videos = 26;
repeated Name genres = 27;
repeated Name countries = 28;
repeated Person persons = 29;
string color = 30;
VendorImage networks = 31;
Distributor distributors = 32;
repeated SpokenLanguages spoken_languages = 33;
ReviewInfo review_info = 34;
repeated SeasonInfo seasons_info = 35;
repeated VendorImage production_companies = 36;
CurrencyValue budget = 37;
Fees fees = 38;
Premiere premiere = 39;
bool tickets_on_sale = 40;
Technology technology = 41;
repeated LinkedMovie similar_movies = 42;
repeated LinkedMovie sequels_and_prequels = 43;
Watchability watchability = 44;
Lists lists = 45;
uint32 kinopoisk_id = 46;
}
syntax = "proto3";
package review;
import "movie.proto";
service KinoposikdevReviewService {
rpc FindById(movie.Id) returns (Reviews);
}
message Review {
uint32 id = 1;
uint32 movie_id = 2;
string title = 3;
string type = 4;
string review = 5;
string date = 6;
string author = 7;
uint32 user_rating = 8;
uint32 review_likes = 9;
uint32 review_dislikes = 10;
uint32 author_id = 11;
}
message Reviews {
repeated Review reviews = 1;
}
syntax = "proto3";
package season;
import "episode.proto";
import "movie.proto";
service KinoposikdevSeasonService {
rpc FindById(movie.Id) returns (Seasons);
}
message Season {
uint32 movie_id = 1;
uint32 number = 2;
uint32 episodes_count = 3;
episode.Episode episodes = 4;
}
message Seasons {
repeated Season seasons = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment