Skip to content

Instantly share code, notes, and snippets.

@rezaindrag
Last active Feb 23, 2021
Embed
What would you like to do?
syntax = "proto3";
package grpc;
option go_package = "./grpc";
service RecipeService {
rpc FetchRecipe(RecipeFilter) returns (RecipeResult) {}
}
service RecipeCategoryService {
rpc Fetch(RecipeCategoryFilter) returns (RecipeCategoryResult) {}
rpc GetByID(RecipeCategoryGetByIDRequest) returns (RecipeResult) {}
}
message RecipeFilter {
string cursor = 1;
int64 num = 2;
string search = 3;
string brands = 4;
string chefs = 5;
string google_token = 6;
string tags = 7;
string ingredients = 8;
string state = 9;
string include_detail = 10;
enum Cooking_time {
cepat = 0;
sedang = 1;
butuh_waktu = 2;
}
Cooking_time cooking_time = 11;
string sort = 12;
string date_range = 13;
string publisher_id = 14;
bool is_external = 15;
}
message Image {
string url = 1;
int32 width = 2;
int32 height = 3;
string mime = 4;
string caption = 5;
}
message Video {
string url = 1;
string ratio = 2;
Image thumbnail = 3;
}
message Ingredient {
string id = 1;
string text = 2;
string name = 3;
string format = 4;
string recipe_ingredient_id = 5;
string uuid = 6;
string ranking = 7;
string type = 8;
string is_primary = 9;
}
message Step {
string text = 1;
string tip = 2;
repeated Image media = 3;
}
message TagTheme {
string text_color = 1;
string background_color = 2;
Image banner = 3;
}
message ChefTheme {
string text_color = 1;
string background_color = 2;
Image image = 3;
}
message TagCategory {
string id = 1;
string name = 2;
string slug = 3;
}
message Tag {
string id = 1;
string name = 2;
TagTheme theme = 3;
TagCategory category = 4;
repeated Tag sub_tags = 5;
string description = 6;
int32 recipe_count = 7;
}
message Brand {
string id = 1;
string name = 2;
string excerpt = 3;
string banner_title = 4;
string banner_description = 5;
Image logo = 6;
Image cover = 7;
Image banner = 8;
}
message Chef {
string id = 1;
string name = 2;
string description = 3;
ChefTheme theme = 4;
int32 recipe_count = 5;
}
message RecipePublisher {
string id = 1;
string name = 2;
string url = 3;
}
message RecipeTip {
string text = 1;
}
message Recipe {
string id = 1;
string type = 2;
string state = 3;
string title = 4;
string description = 5;
Image thumbnail = 6;
Video video = 7;
Video video_stream = 8;
int32 cooking_time = 9;
repeated Ingredient ingredients = 10;
repeated Step steps = 11;
repeated RecipeTip tips = 12;
repeated Tag tags = 13;
string slug = 14;
string create_time = 15;
string update_time = 16;
int32 portion = 17;
double rating = 18;
int32 current_step = 19;
int32 total_view = 20;
bool in_shopping_list = 21;
int32 total_testimonial = 22;
repeated Brand brands = 23;
repeated Chef chefs = 24;
RecipePublisher publisher = 25;
string original_url = 26;
string content = 27;
repeated RecipeBody body = 28;
}
message ResultFilter {
repeated Ingredient ingredients = 1;
repeated Tag tags = 2;
repeated Tag exclude_tags = 3;
repeated Brand brands = 4;
repeated Chef chefs = 5;
string cooking_time = 6;
}
message RecipeResult {
repeated Recipe items = 1;
string id = 2;
string title = 3;
int32 count = 4;
ResultFilter filter = 5;
Image cover = 6;
Image icon = 7;
string cursor = 8;
string description = 9;
string label = 10;
string type = 11;
}
message RecipeCategoryFilter {
string cursor = 1;
int64 num = 2;
string search = 3;
string brands = 4;
string chefs = 5;
string exclude_tags = 6;
string tags = 7;
string ingredients = 8;
enum Cooking_time {
cepat = 0;
sedang = 1;
butuh_waktu = 2;
}
Cooking_time cooking_time = 9;
string type = 10;
}
message RecipeCategoryResult {
repeated RecipeResult items = 1;
string id = 2;
string title = 3;
int32 count = 4;
string cursor = 8;
string description = 9;
}
message RecipeCategoryGetByIDRequest {
string id = 1;
string cursor = 2;
int32 limit = 3;
bool include_item = 4;
string sort = 5;
}
message RecipeBody {
oneof body {
Image image = 1;
RecipeTextBody text = 2;
RecipeEmbeddedWebBody embeddedweb = 3;
RecipeVideoBody embeddedvideo = 4;
}
}
message RecipeTextBody {
string type = 1;
string text = 2;
string format = 3;
}
message RecipeEmbeddedWebBody {
string type = 1;
string url = 2;
int32 x_ratio = 3;
int32 y_ratio = 4;
}
message RecipeVideoBody {
string type = 1;
string provider = 2;
string embedded_url = 3;
string caption = 4;
string src = 5;
Image thumbnail = 6;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment