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";
package tester.v1;
option go_package = "/tester/v1;testerv1";
package problem.v1;
option go_package = "/problem/v1;problemv1";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
service TesterService {
rpc CreateProblem (CreateProblemRequest) returns (CreateProblemResponse);
service ProblemService {
rpc CreateProblem (stream CreateProblemRequest) returns (CreateProblemResponse);
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);
}
@ -20,8 +20,15 @@ message CreateProblemRequest {
int32 time_limit = 3;
int32 memory_limit = 4;
}
message Test {
bytes chunk = 1;
}
oneof msg {
string token = 1;
Problem problem = 2;
Test test = 3;
}
}
message CreateProblemResponse {
int32 id = 1;
@ -45,17 +52,17 @@ message ReadProblemResponse {
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 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;