|
|
@ -1,69 +1,60 @@ |
|
|
|
syntax = "proto3"; |
|
|
|
|
|
|
|
/* >> |
|
|
|
import "google/api/annotations.proto"; |
|
|
|
<< */ |
|
|
|
|
|
|
|
|
|
|
|
package CatalogApi; |
|
|
|
|
|
|
|
message CatalogItemRequest { |
|
|
|
int32 id = 1; |
|
|
|
} |
|
|
|
|
|
|
|
message CatalogItemsRequest { |
|
|
|
string ids = 1; |
|
|
|
|
|
|
|
int32 pageSize = 2; |
|
|
|
|
|
|
|
int32 pageIndex = 3; |
|
|
|
} |
|
|
|
|
|
|
|
message CatalogItemResponse { |
|
|
|
int32 id = 1; |
|
|
|
|
|
|
|
string name = 2; |
|
|
|
|
|
|
|
string description=3; |
|
|
|
|
|
|
|
double price=4; |
|
|
|
|
|
|
|
string picture_file_name=5; |
|
|
|
|
|
|
|
string picture_uri=6; |
|
|
|
|
|
|
|
CatalogType catalog_type=8; |
|
|
|
|
|
|
|
CatalogBrand catalog_brand=10; |
|
|
|
|
|
|
|
int32 available_stock=11; |
|
|
|
|
|
|
|
int32 restock_threshold=12; |
|
|
|
|
|
|
|
int32 max_stock_threshold=13; |
|
|
|
|
|
|
|
bool on_reorder=14; |
|
|
|
string description=3; |
|
|
|
double price=4; |
|
|
|
string picture_file_name=5; |
|
|
|
string picture_uri=6; |
|
|
|
CatalogType catalog_type=8; |
|
|
|
CatalogBrand catalog_brand=10; |
|
|
|
int32 available_stock=11; |
|
|
|
int32 restock_threshold=12; |
|
|
|
int32 max_stock_threshold=13; |
|
|
|
bool on_reorder=14; |
|
|
|
} |
|
|
|
|
|
|
|
message CatalogBrand { |
|
|
|
int32 id = 1; |
|
|
|
|
|
|
|
string name = 2; |
|
|
|
} |
|
|
|
|
|
|
|
message CatalogType { |
|
|
|
int32 id = 1; |
|
|
|
|
|
|
|
string type = 2; |
|
|
|
} |
|
|
|
|
|
|
|
message PaginatedItemsResponse { |
|
|
|
int32 pageIndex = 1; |
|
|
|
|
|
|
|
int32 pageSize = 2; |
|
|
|
|
|
|
|
int64 count = 3; |
|
|
|
|
|
|
|
repeated CatalogItemResponse data = 4; |
|
|
|
} |
|
|
|
|
|
|
|
service Catalog { |
|
|
|
rpc GetItemById (CatalogItemRequest) returns (CatalogItemResponse) {} |
|
|
|
|
|
|
|
rpc GetItemById (CatalogItemRequest) returns (CatalogItemResponse) { |
|
|
|
/* >> |
|
|
|
option (google.api.http) = { |
|
|
|
get: "/api/v1/catalog/items/{id}" |
|
|
|
}; |
|
|
|
<< */ |
|
|
|
} |
|
|
|
rpc GetItemsByIds (CatalogItemsRequest) returns (PaginatedItemsResponse) {} |
|
|
|
} |