contracts/problem/v1/problem.proto

66 lines
1.5 KiB
Protocol Buffer
Raw Permalink Normal View History

2024-08-16 11:22:41 +00:00
syntax = "proto3";
2024-08-18 06:56:39 +00:00
package problem.v1;
option go_package = "/problem/v1;problemv1";
2024-08-16 11:22:41 +00:00
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
2024-08-18 06:56:39 +00:00
service ProblemService {
rpc CreateProblem (stream CreateProblemRequest) returns (CreateProblemResponse);
2024-08-16 11:22:41 +00:00
rpc ReadProblem (ReadProblemRequest) returns (ReadProblemResponse);
2024-08-18 06:56:39 +00:00
// rpc UpdateProblem (UpdateProblemRequest) returns (google.protobuf.Empty);
2024-08-16 11:22:41 +00:00
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;
}
2024-08-18 06:56:39 +00:00
message Test {
bytes chunk = 1;
}
oneof msg {
2024-08-20 11:34:43 +00:00
Problem problem = 1;
Test test = 2;
2024-08-18 06:56:39 +00:00
}
2024-08-16 11:22:41 +00:00
}
message CreateProblemResponse {
int32 id = 1;
}
message ReadProblemRequest {
2024-08-20 11:34:43 +00:00
int32 id = 1;
2024-08-16 11:22:41 +00:00
}
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;
}
2024-08-20 11:34:43 +00:00
Problem problem = 1;
2024-08-16 11:22:41 +00:00
}
2024-08-18 06:56:39 +00:00
//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;
//}
2024-08-16 11:22:41 +00:00
message DeleteProblemRequest {
2024-08-20 11:34:43 +00:00
int32 id = 1;
2024-08-16 11:22:41 +00:00
}