fix: add problem service

This commit is contained in:
Vyacheslav1557 2024-08-18 11:56:39 +05:00
parent f25fe45818
commit 603a74b1c3

View file

@ -1,15 +1,15 @@
syntax = "proto3"; syntax = "proto3";
package tester.v1; package problem.v1;
option go_package = "/tester/v1;testerv1"; option go_package = "/problem/v1;problemv1";
import "google/protobuf/timestamp.proto"; import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto"; import "google/protobuf/empty.proto";
service TesterService { service ProblemService {
rpc CreateProblem (CreateProblemRequest) returns (CreateProblemResponse); rpc CreateProblem (stream CreateProblemRequest) returns (CreateProblemResponse);
rpc ReadProblem (ReadProblemRequest) returns (ReadProblemResponse); rpc ReadProblem (ReadProblemRequest) returns (ReadProblemResponse);
rpc UpdateProblem (UpdateProblemRequest) returns (google.protobuf.Empty); // rpc UpdateProblem (UpdateProblemRequest) returns (google.protobuf.Empty);
rpc DeleteProblem (DeleteProblemRequest) returns (google.protobuf.Empty); rpc DeleteProblem (DeleteProblemRequest) returns (google.protobuf.Empty);
} }
@ -20,8 +20,15 @@ message CreateProblemRequest {
int32 time_limit = 3; int32 time_limit = 3;
int32 memory_limit = 4; int32 memory_limit = 4;
} }
string token = 1; message Test {
Problem problem = 2; bytes chunk = 1;
}
oneof msg {
string token = 1;
Problem problem = 2;
Test test = 3;
}
} }
message CreateProblemResponse { message CreateProblemResponse {
int32 id = 1; int32 id = 1;
@ -45,17 +52,17 @@ message ReadProblemResponse {
Problem problem = 2; Problem problem = 2;
} }
message UpdateProblemRequest { //message UpdateProblemRequest {
message Problem { // message Problem {
int32 id = 1; // int32 id = 1;
optional string name = 2; // optional string name = 2;
optional string description = 3; // optional string description = 3;
optional int32 time_limit = 4; // optional int32 time_limit = 4;
optional int32 memory_limit = 5; // optional int32 memory_limit = 5;
} // }
string token = 1; // string token = 1;
Problem problem = 2; // Problem problem = 2;
} //}
message DeleteProblemRequest { message DeleteProblemRequest {
string token = 1; string token = 1;