Added the service protos and interface

This commit is contained in:
Taha Afzal committed 2018-11-29 10:14:43 -05:00
1 parent 7151619645
commit f04b22fbb5
1 file changed
+96
+96
View File
@@ -0,0 +1,96 @@
syntax="proto3";
package bts.api.orderman;
option csharp_namespace="bts.api.orderman";
import "lib/api/apioptions.proto";
import "lib/api/apicore.proto";
import "lib/domain_model/Security.proto";
import "lib/api/services/OrderService.proto";
import "google/protobuf/timestamp.proto";
message PersistenceRecordCommon{
int32 id = 1;
bool is_active = 10;
int32 creator_user_id = 20;
google.protobuf.Timestamp creation_time = 30;
google.protobuf.Timestamp last_edit_time = 40;
google.protobuf.Timestamp deletion_time = 50;
}
message ComspositeAlgoDefinition {
string name = 10;
CustomOrderDefinition algo = 20;
// re-naming map in the future
}
message ComspositeAlgoRecord {
PersistenceRecordCommon common = 10;
ComspositeAlgoDefinition algo_definition = 20;
}
message AlgoTemplate{
string name = 10;
// this is where the data is
oneof algo_params{
ComspositeAlgoDefinition composite_algo_params = 20;
CustomOrderDefinition system_algo_params = 30;
}
bool is_default = 40;
}
message AlgoTemplateRecord{
PersistenceRecordCommon common = 10;
AlgoTemplate algo_template = 20;
}
///////////////////////////////////////////////////////////
// API ////////////////////////////////////////////////////
message ComspositeAlgoCreateRequest{
int32 user_id = 10;
ComspositeAlgoDefinition algo = 20;
}
message ComspositeAlgoCreateResult{
bool success = 10;
string err_msg = 20;
ComspositeAlgoRecord record = 30;
}
message TemplateCreateRequest{
int32 user_id = 10;
AlgoTemplate new_template = 20;
}
message TemplateCreateResult{
bool success = 10;
string err_msg = 20;
AlgoTemplateRecord record = 30;
}
message TemplateUpdateRequest{
int32 template_id = 10;
AlgoTemplate updated_template = 20;
}
message AlgoServiceRemoveRequest{
int32 id = 10;
}
message AlgoServiceReply{
bool success = 10;
bool err_msg = 20;
}
service AlgoService {
option (bts.api.service_description) = "Provides an interface to manage composite algos and templates";
// create composite
rpc create_composite_algo (ComspositeAlgoCreateRequest) returns (ComspositeAlgoCreateResult);
// create template
rpc create_template (TemplateCreateRequest) returns (TemplateCreateResult);
// changing parameters of an existing template
rpc update_template (TemplateUpdateRequest) returns (AlgoServiceReply);
// remove template
rpc remove_template (AlgoServiceRemoveRequest) returns (AlgoServiceReply);
}