109 lines
2.6 KiB
Protocol Buffer
109 lines
2.6 KiB
Protocol Buffer
|
|
syntax = "proto3";
|
||
|
|
|
||
|
|
package package;
|
||
|
|
|
||
|
|
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.Package";
|
||
|
|
|
||
|
|
service PackageContract
|
||
|
|
{
|
||
|
|
rpc CreateNewPackage(CreateNewPackageRequest) returns (CreateNewPackageResponse){
|
||
|
|
option (google.api.http) = {
|
||
|
|
post: "/CreateNewPackage"
|
||
|
|
body: "*"
|
||
|
|
};
|
||
|
|
};
|
||
|
|
rpc UpdatePackage(UpdatePackageRequest) returns (google.protobuf.Empty){
|
||
|
|
option (google.api.http) = {
|
||
|
|
put: "/UpdatePackage"
|
||
|
|
body: "*"
|
||
|
|
};
|
||
|
|
};
|
||
|
|
rpc DeletePackage(DeletePackageRequest) returns (google.protobuf.Empty){
|
||
|
|
option (google.api.http) = {
|
||
|
|
delete: "/DeletePackage"
|
||
|
|
body: "*"
|
||
|
|
};
|
||
|
|
};
|
||
|
|
rpc GetPackage(GetPackageRequest) returns (GetPackageResponse){
|
||
|
|
option (google.api.http) = {
|
||
|
|
get: "/GetPackage"
|
||
|
|
|
||
|
|
};
|
||
|
|
};
|
||
|
|
rpc GetAllPackageByFilter(GetAllPackageByFilterRequest) returns (GetAllPackageByFilterResponse){
|
||
|
|
option (google.api.http) = {
|
||
|
|
get: "/GetAllPackageByFilter"
|
||
|
|
|
||
|
|
};
|
||
|
|
};
|
||
|
|
}
|
||
|
|
message CreateNewPackageRequest
|
||
|
|
{
|
||
|
|
string title = 1;
|
||
|
|
string description = 2;
|
||
|
|
string image_path = 3;
|
||
|
|
int64 price = 4;
|
||
|
|
}
|
||
|
|
message CreateNewPackageResponse
|
||
|
|
{
|
||
|
|
int64 id = 1;
|
||
|
|
}
|
||
|
|
message UpdatePackageRequest
|
||
|
|
{
|
||
|
|
int64 id = 1;
|
||
|
|
string title = 2;
|
||
|
|
string description = 3;
|
||
|
|
string image_path = 4;
|
||
|
|
int64 price = 5;
|
||
|
|
}
|
||
|
|
message DeletePackageRequest
|
||
|
|
{
|
||
|
|
int64 id = 1;
|
||
|
|
}
|
||
|
|
message GetPackageRequest
|
||
|
|
{
|
||
|
|
int64 id = 1;
|
||
|
|
}
|
||
|
|
message GetPackageResponse
|
||
|
|
{
|
||
|
|
int64 id = 1;
|
||
|
|
string title = 2;
|
||
|
|
string description = 3;
|
||
|
|
string image_path = 4;
|
||
|
|
int64 price = 5;
|
||
|
|
}
|
||
|
|
message GetAllPackageByFilterRequest
|
||
|
|
{
|
||
|
|
messages.PaginationState pagination_state = 1;
|
||
|
|
google.protobuf.StringValue sort_by = 2;
|
||
|
|
GetAllPackageByFilterFilter filter = 3;
|
||
|
|
}
|
||
|
|
message GetAllPackageByFilterFilter
|
||
|
|
{
|
||
|
|
google.protobuf.Int64Value id = 1;
|
||
|
|
google.protobuf.StringValue title = 2;
|
||
|
|
google.protobuf.StringValue description = 3;
|
||
|
|
google.protobuf.StringValue image_path = 4;
|
||
|
|
google.protobuf.Int64Value price = 5;
|
||
|
|
}
|
||
|
|
message GetAllPackageByFilterResponse
|
||
|
|
{
|
||
|
|
messages.MetaData meta_data = 1;
|
||
|
|
repeated GetAllPackageByFilterResponseModel models = 2;
|
||
|
|
}
|
||
|
|
message GetAllPackageByFilterResponseModel
|
||
|
|
{
|
||
|
|
int64 id = 1;
|
||
|
|
string title = 2;
|
||
|
|
string description = 3;
|
||
|
|
string image_path = 4;
|
||
|
|
int64 price = 5;
|
||
|
|
}
|