contracts/problem/v1/problem.proto

42 lines
968 B
Protocol Buffer
Raw 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 {
2024-10-13 14:03:03 +00:00
rpc CreateProblem (CreateProblemRequest) returns (CreateProblemResponse);
2024-08-16 11:22:41 +00:00
rpc ReadProblem (ReadProblemRequest) returns (ReadProblemResponse);
rpc DeleteProblem (DeleteProblemRequest) returns (google.protobuf.Empty);
}
message CreateProblemRequest {
2024-10-13 14:03:03 +00:00
string title = 1;
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;
2024-10-13 14:03:03 +00:00
string title = 2;
string content = 3;
2024-08-16 11:22:41 +00:00
int32 time_limit = 4;
int32 memory_limit = 5;
2024-10-13 14:03:03 +00:00
int32 testing_strategy = 6;
string testing_order = 7;
google.protobuf.Timestamp created_at = 8;
google.protobuf.Timestamp updated_at = 9;
2024-08-16 11:22:41 +00:00
}
2024-08-20 11:34:43 +00:00
Problem problem = 1;
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
}