Files
komp_ac/proto/api.proto
2025-02-21 17:23:55 +01:00

107 lines
2.7 KiB
Protocol Buffer

// proto/api.proto
syntax = "proto3";
package multieko2;
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
rpc GetTableStructure (Empty) returns (TableStructureResponse); // New endpoint for table structure
}
// Existing messages
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;
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 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
}
// New messages for the table structure endpoint
message TableStructureResponse {
repeated TableColumn columns = 1; // List of columns in the table
}
message TableColumn {
string name = 1; // Name of the column
string data_type = 2; // Data type of the column (e.g., TEXT, INT, etc.)
bool is_nullable = 3; // Whether the column allows NULL values
bool is_primary_key = 4; // Whether the column is a primary key
}