Files
komp_ac/proto/api.proto
2025-02-18 14:40:23 +01:00

105 lines
2.4 KiB
Protocol Buffer

// proto/api.proto
syntax = "proto3";
package multieko2;
service DataProcessor {
rpc ProcessData (DataRequest) returns (DataResponse);
}
service Adresar {
rpc PostAdresar (PostAdresarRequest) returns (AdresarResponse);
rpc GetAdresar (GetAdresarRequest) returns (AdresarResponse);
rpc PutAdresar (PutAdresarRequest) returns (AdresarResponse);
rpc DeleteAdresar (DeleteAdresarRequest) returns (DeleteAdresarResponse);
rpc GetAdresarCount (Empty) returns (CountResponse); // New endpoint
rpc GetAdresarByPosition (PositionRequest) returns (AdresarResponse); // New endpoint
}
message GetAdresarRequest {
int64 id = 1; // The ID of the Adresar entry to retrieve
}
message DeleteAdresarRequest {
int64 id = 1; // The ID of the Adresar entry to delete
}
message PostAdresarRequest {
string firma = 1;
string kz = 2;
string drc = 3;
string ulica = 4;
string psc = 5;
string mesto = 6;
string stat = 7;
string banka = 8;
string ucet = 9;
string skladm = 10;
string ico = 11;
string kontakt = 12;
string telefon = 13;
string skladu = 14;
string fax = 15;
}
message AdresarResponse {
int64 id = 1;
string firma = 2;
string kz = 3;
string drc = 4;
string ulica = 5;
string psc = 6;
string mesto = 7;
string stat = 8;
string banka = 9;
string ucet = 10;
string skladm = 11;
string ico = 12;
string kontakt = 13;
string telefon = 14;
string skladu = 15;
string fax = 16;
}
message PutAdresarRequest {
int64 id = 1; // The ID of the Adresar entry to update
string firma = 2;
string kz = 3;
string drc = 4;
string ulica = 5;
string psc = 6;
string mesto = 7;
string stat = 8;
string banka = 9;
string ucet = 10;
string skladm = 11;
string ico = 12;
string kontakt = 13;
string telefon = 14;
string skladu = 15;
string fax = 16;
}
message DataRequest {
string data = 1;
}
message DataResponse {
string processed_data = 1;
}
message DeleteAdresarResponse {
bool success = 1; // Indicates whether the deletion was successful
}
// New messages for the additional endpoints
message Empty {} // Empty request for count
message CountResponse {
int64 count = 1; // Response with the count of items
}
message PositionRequest {
int64 position = 1; // Request with the position of the item to retrieve
}