From 816de26ce9015ec9f3b6de54e8b5bbbd203a09db Mon Sep 17 00:00:00 2001 From: Vyacheslav1557 Date: Fri, 16 Aug 2024 16:22:41 +0500 Subject: [PATCH] feat: add tester proto --- tester/v1/tester.proto | 62 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 tester/v1/tester.proto diff --git a/tester/v1/tester.proto b/tester/v1/tester.proto new file mode 100644 index 0000000..cd1ed33 --- /dev/null +++ b/tester/v1/tester.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; + +package proto.tester.v1; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/empty.proto"; + +service TesterService { + rpc CreateProblem (CreateProblemRequest) returns (CreateProblemResponse); + rpc ReadProblem (ReadProblemRequest) returns (ReadProblemResponse); + rpc UpdateProblem (UpdateProblemRequest) returns (google.protobuf.Empty); + rpc DeleteProblem (DeleteProblemRequest) returns (google.protobuf.Empty); +} + +message CreateProblemRequest { + message Problem { + string name = 1; + string description = 2; + int32 time_limit = 3; + int32 memory_limit = 4; + } + string token = 1; + Problem problem = 2; +} +message CreateProblemResponse { + int32 id = 1; +} + +message ReadProblemRequest { + string token = 1; + int32 id = 2; +} +message ReadProblemResponse { + message Problem { + int32 id = 1; + string name = 2; + string description = 3; + int32 time_limit = 4; + int32 memory_limit = 5; + google.protobuf.Timestamp created_at = 6; + google.protobuf.Timestamp updated_at = 7; + } + string token = 1; + Problem problem = 2; +} + +message UpdateProblemRequest { + message Problem { + int32 id = 1; + optional string name = 2; + optional string description = 3; + optional int32 time_limit = 4; + optional int32 memory_limit = 5; + } + string token = 1; + Problem problem = 2; +} + +message DeleteProblemRequest { + string token = 1; + int32 id = 2; +} \ No newline at end of file