dotnet-cqrs/Svrnty.CQRS.Grpc.Sample/Protos/cqrs_services.proto

59 lines
1.2 KiB
Protocol Buffer

syntax = "proto3";
option csharp_namespace = "Svrnty.CQRS.Grpc.Sample.Grpc";
package cqrs;
// Command service for CQRS operations
service CommandService {
// Adds a new user and returns the user ID
rpc AddUser (AddUserCommandRequest) returns (AddUserCommandResponse);
// Removes a user
rpc RemoveUser (RemoveUserCommandRequest) returns (RemoveUserCommandResponse);
}
// Query service for CQRS operations
service QueryService {
// Fetches a user by ID
rpc FetchUser (FetchUserQueryRequest) returns (FetchUserQueryResponse);
}
// Request message for adding a user
message AddUserCommandRequest {
string name = 1;
string email = 2;
int32 age = 3;
}
// Response message containing the added user ID
message AddUserCommandResponse {
int32 result = 1;
}
// Request message for removing a user
message RemoveUserCommandRequest {
int32 user_id = 1;
}
// Response message for remove user (empty)
message RemoveUserCommandResponse {
}
// Request message for fetching a user
message FetchUserQueryRequest {
int32 user_id = 1;
}
// Response message containing the user
message FetchUserQueryResponse {
User result = 1;
}
// User entity
message User {
int32 id = 1;
string name = 2;
string email = 3;
}