feat: add movie search service (#293)

* feat: add movie search service
close #183

* chore: update display name

* chore: code review fix

* feat: avoid panic when fields would be null or missed

* chore: make it more readable

* fix: correct format
This commit is contained in:
zhaoyang
2021-12-07 19:27:10 +08:00
committed by GitHub
parent ea15a0f0fe
commit e53c3bb52c
15 changed files with 911 additions and 1 deletions

50
movie/proto/movie.proto Normal file
View File

@@ -0,0 +1,50 @@
syntax = "proto3";
package movie;
option go_package = "./proto;movie";
service Movie {
rpc Search(SearchRequest) returns (SearchResponse) {}
}
message MovieInfo {
string poster_path = 1;
bool adult = 2;
string overview = 3;
string release_date = 4;
repeated int32 genre_ids = 5;
int32 id = 6;
string original_title = 7;
string original_language = 8;
string title = 9;
string backdrop_path = 10;
double popularity = 11;
int32 vote_count = 12;
bool video = 13;
double vote_average = 14;
}
message SearchRequest {
// a ISO 639-1 value to display translated data
string language = 1;
// a text query to search
string query = 2;
// page to query
int32 page = 3;
// a ISO 3166-1 code to filter release dates.
string region = 4;
int32 year = 5;
int32 primary_release_year = 6;
}
message SearchResponse {
int32 total_results = 1;
int32 total_pages = 2;
int32 page = 3;
repeated MovieInfo results = 4;
}