149 lines
3.9 KiB
Protocol Buffer
149 lines
3.9 KiB
Protocol Buffer
|
|
syntax = "proto3";
|
||
|
|
|
||
|
|
package products;
|
||
|
|
|
||
|
|
import "public_messages.proto";
|
||
|
|
import "google/protobuf/empty.proto";
|
||
|
|
import "google/protobuf/wrappers.proto";
|
||
|
|
import "google/protobuf/duration.proto";
|
||
|
|
import "google/protobuf/timestamp.proto";
|
||
|
|
import "google/api/annotations.proto";
|
||
|
|
|
||
|
|
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.Products";
|
||
|
|
|
||
|
|
service ProductsContract
|
||
|
|
{
|
||
|
|
rpc CreateNewProducts(CreateNewProductsRequest) returns (CreateNewProductsResponse){
|
||
|
|
option (google.api.http) = {
|
||
|
|
post: "/CreateNewProducts"
|
||
|
|
body: "*"
|
||
|
|
};
|
||
|
|
};
|
||
|
|
rpc UpdateProducts(UpdateProductsRequest) returns (google.protobuf.Empty){
|
||
|
|
option (google.api.http) = {
|
||
|
|
put: "/UpdateProducts"
|
||
|
|
body: "*"
|
||
|
|
};
|
||
|
|
};
|
||
|
|
rpc DeleteProducts(DeleteProductsRequest) returns (google.protobuf.Empty){
|
||
|
|
option (google.api.http) = {
|
||
|
|
delete: "/DeleteProducts"
|
||
|
|
body: "*"
|
||
|
|
};
|
||
|
|
};
|
||
|
|
rpc GetProducts(GetProductsRequest) returns (GetProductsResponse){
|
||
|
|
option (google.api.http) = {
|
||
|
|
get: "/GetProducts"
|
||
|
|
|
||
|
|
};
|
||
|
|
};
|
||
|
|
rpc GetAllProductsByFilter(GetAllProductsByFilterRequest) returns (GetAllProductsByFilterResponse){
|
||
|
|
option (google.api.http) = {
|
||
|
|
get: "/GetAllProductsByFilter"
|
||
|
|
|
||
|
|
};
|
||
|
|
};
|
||
|
|
}
|
||
|
|
message CreateNewProductsRequest
|
||
|
|
{
|
||
|
|
string title = 1;
|
||
|
|
string description = 2;
|
||
|
|
string short_infomation = 3;
|
||
|
|
string full_information = 4;
|
||
|
|
int64 price = 5;
|
||
|
|
int32 discount = 6;
|
||
|
|
int32 rate = 7;
|
||
|
|
string image_path = 8;
|
||
|
|
string thumbnail_path = 9;
|
||
|
|
int32 sale_count = 10;
|
||
|
|
int32 view_count = 11;
|
||
|
|
int32 remaining_count = 12;
|
||
|
|
}
|
||
|
|
message CreateNewProductsResponse
|
||
|
|
{
|
||
|
|
int64 id = 1;
|
||
|
|
}
|
||
|
|
message UpdateProductsRequest
|
||
|
|
{
|
||
|
|
int64 id = 1;
|
||
|
|
string title = 2;
|
||
|
|
string description = 3;
|
||
|
|
string short_infomation = 4;
|
||
|
|
string full_information = 5;
|
||
|
|
int64 price = 6;
|
||
|
|
int32 discount = 7;
|
||
|
|
int32 rate = 8;
|
||
|
|
string image_path = 9;
|
||
|
|
string thumbnail_path = 10;
|
||
|
|
int32 sale_count = 11;
|
||
|
|
int32 view_count = 12;
|
||
|
|
int32 remaining_count = 13;
|
||
|
|
}
|
||
|
|
message DeleteProductsRequest
|
||
|
|
{
|
||
|
|
int64 id = 1;
|
||
|
|
}
|
||
|
|
message GetProductsRequest
|
||
|
|
{
|
||
|
|
int64 id = 1;
|
||
|
|
}
|
||
|
|
message GetProductsResponse
|
||
|
|
{
|
||
|
|
int64 id = 1;
|
||
|
|
string title = 2;
|
||
|
|
string description = 3;
|
||
|
|
string short_infomation = 4;
|
||
|
|
string full_information = 5;
|
||
|
|
int64 price = 6;
|
||
|
|
int32 discount = 7;
|
||
|
|
int32 rate = 8;
|
||
|
|
string image_path = 9;
|
||
|
|
string thumbnail_path = 10;
|
||
|
|
int32 sale_count = 11;
|
||
|
|
int32 view_count = 12;
|
||
|
|
int32 remaining_count = 13;
|
||
|
|
}
|
||
|
|
message GetAllProductsByFilterRequest
|
||
|
|
{
|
||
|
|
messages.PaginationState pagination_state = 1;
|
||
|
|
google.protobuf.StringValue sort_by = 2;
|
||
|
|
GetAllProductsByFilterFilter filter = 3;
|
||
|
|
}
|
||
|
|
message GetAllProductsByFilterFilter
|
||
|
|
{
|
||
|
|
google.protobuf.Int64Value id = 1;
|
||
|
|
google.protobuf.StringValue title = 2;
|
||
|
|
google.protobuf.StringValue description = 3;
|
||
|
|
google.protobuf.StringValue short_infomation = 4;
|
||
|
|
google.protobuf.StringValue full_information = 5;
|
||
|
|
google.protobuf.Int64Value price = 6;
|
||
|
|
google.protobuf.Int32Value discount = 7;
|
||
|
|
google.protobuf.Int32Value rate = 8;
|
||
|
|
google.protobuf.StringValue image_path = 9;
|
||
|
|
google.protobuf.StringValue thumbnail_path = 10;
|
||
|
|
google.protobuf.Int32Value sale_count = 11;
|
||
|
|
google.protobuf.Int32Value view_count = 12;
|
||
|
|
google.protobuf.Int32Value remaining_count = 13;
|
||
|
|
}
|
||
|
|
message GetAllProductsByFilterResponse
|
||
|
|
{
|
||
|
|
messages.MetaData meta_data = 1;
|
||
|
|
repeated GetAllProductsByFilterResponseModel models = 2;
|
||
|
|
}
|
||
|
|
message GetAllProductsByFilterResponseModel
|
||
|
|
{
|
||
|
|
int64 id = 1;
|
||
|
|
string title = 2;
|
||
|
|
string description = 3;
|
||
|
|
string short_infomation = 4;
|
||
|
|
string full_information = 5;
|
||
|
|
int64 price = 6;
|
||
|
|
int32 discount = 7;
|
||
|
|
int32 rate = 8;
|
||
|
|
string image_path = 9;
|
||
|
|
string thumbnail_path = 10;
|
||
|
|
int32 sale_count = 11;
|
||
|
|
int32 view_count = 12;
|
||
|
|
int32 remaining_count = 13;
|
||
|
|
}
|