fix: add problem service
This commit is contained in:
parent
f25fe45818
commit
603a74b1c3
1 changed files with 25 additions and 18 deletions
70
problem/v1/problem.proto
Normal file
70
problem/v1/problem.proto
Normal file
|
@ -0,0 +1,70 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package problem.v1;
|
||||
option go_package = "/problem/v1;problemv1";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
service ProblemService {
|
||||
rpc CreateProblem (stream 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;
|
||||
}
|
||||
message Test {
|
||||
bytes chunk = 1;
|
||||
}
|
||||
|
||||
oneof msg {
|
||||
string token = 1;
|
||||
Problem problem = 2;
|
||||
Test test = 3;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue