refactor: update protobuf imports and add HTTP annotations

This commit is contained in:
masoodafar-web
2025-12-08 04:43:03 +03:30
parent fd3c17ac23
commit ca28678e8f
25 changed files with 207 additions and 53 deletions

View File

@@ -6,18 +6,50 @@ import "public_messages.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "BackOffice.BFF.NetworkMembership.Protobuf";
option csharp_namespace = "Foursat.BackOffice.BFF.NetworkMembership.Protos";
service NetworkMembershipContract
{
rpc JoinNetwork(JoinNetworkRequest) returns (google.protobuf.Empty);
rpc ChangeNetworkParent(ChangeNetworkParentRequest) returns (google.protobuf.Empty);
rpc RemoveFromNetwork(RemoveFromNetworkRequest) returns (google.protobuf.Empty);
rpc GetUserNetwork(GetUserNetworkRequest) returns (GetUserNetworkResponse);
rpc GetNetworkTree(GetNetworkTreeRequest) returns (GetNetworkTreeResponse);
rpc GetNetworkMembershipHistory(GetNetworkMembershipHistoryRequest) returns (GetNetworkMembershipHistoryResponse);
rpc GetNetworkStatistics(GetNetworkStatisticsRequest) returns (GetNetworkStatisticsResponse);
rpc JoinNetwork(JoinNetworkRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/JoinNetwork"
body: "*"
};
};
rpc ChangeNetworkParent(ChangeNetworkParentRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/ChangeNetworkParent"
body: "*"
};
};
rpc RemoveFromNetwork(RemoveFromNetworkRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
delete: "/RemoveFromNetwork"
body: "*"
};
};
rpc GetUserNetwork(GetUserNetworkRequest) returns (GetUserNetworkResponse){
option (google.api.http) = {
get: "/GetUserNetwork"
};
};
rpc GetNetworkTree(GetNetworkTreeRequest) returns (GetNetworkTreeResponse){
option (google.api.http) = {
get: "/GetNetworkTree"
};
};
rpc GetNetworkMembershipHistory(GetNetworkMembershipHistoryRequest) returns (GetNetworkMembershipHistoryResponse){
option (google.api.http) = {
get: "/GetNetworkMembershipHistory"
};
};
rpc GetNetworkStatistics(GetNetworkStatisticsRequest) returns (GetNetworkStatisticsResponse){
option (google.api.http) = {
get: "/GetNetworkStatistics"
};
};
}
// JoinNetwork Command
@@ -72,7 +104,7 @@ message GetUserNetworkResponse
// GetNetworkTree Query
message GetNetworkTreeRequest
{
int64 root_user_id = 1;
int64 user_id = 1;
google.protobuf.Int32Value max_depth = 2;
google.protobuf.BoolValue only_active = 3;
}
@@ -87,9 +119,9 @@ message NetworkTreeNodeModel
int64 user_id = 1;
string user_name = 2;
google.protobuf.Int64Value parent_id = 3;
int32 network_leg = 4;
int32 network_level = 5;
bool is_active = 6;
google.protobuf.Int32Value network_leg = 4;
google.protobuf.Int32Value network_level = 5;
google.protobuf.BoolValue is_active = 6;
google.protobuf.Timestamp joined_at = 7;
}