Initial commit
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
syntax = "proto3";
|
||||
package task;
|
||||
|
||||
option go_package = "pkg/api/task";
|
||||
|
||||
service TaskService {
|
||||
rpc StartCompetition(StartCompetitionRequest) returns (StartCompetitionResponse);
|
||||
rpc GetCompetitionTasks(GetCompetitionTasksRequest) returns (GetCompetitionTasksResponse);
|
||||
rpc GetTask(GetTaskRequest) returns (GetTaskResponse);
|
||||
rpc SubmitTask(SubmitTaskRequest) returns (SubmitTaskResponse);
|
||||
rpc GetSubmissionsHistory(GetSubmissionsHistoryRequest) returns (GetSubmissionsHistoryResponse);
|
||||
rpc GetTaskAttachments(GetTaskAttachmentsRequest) returns (GetTaskAttachmentsResponse);
|
||||
rpc GetCompetitionResults(GetCompetitionResultsRequest) returns (GetCompetitionResultsResponse);
|
||||
}
|
||||
|
||||
message StartCompetitionRequest {
|
||||
string competition_id = 1;
|
||||
}
|
||||
message StartCompetitionResponse {
|
||||
string status = 1;
|
||||
}
|
||||
|
||||
message GetCompetitionTasksRequest {
|
||||
string competition_id = 1;
|
||||
}
|
||||
message GetCompetitionTasksResponse {
|
||||
repeated Task tasks = 1;
|
||||
}
|
||||
|
||||
message GetTaskRequest {
|
||||
string competition_id = 1;
|
||||
string task_id = 2;
|
||||
}
|
||||
message GetTaskResponse {
|
||||
Task task = 1;
|
||||
}
|
||||
|
||||
message SubmitTaskRequest {
|
||||
string competition_id = 1;
|
||||
string task_id = 2;
|
||||
bytes content = 3;
|
||||
}
|
||||
message SubmitTaskResponse {
|
||||
string submission_id = 1;
|
||||
}
|
||||
|
||||
message GetSubmissionsHistoryRequest {
|
||||
string competition_id = 1;
|
||||
string task_id = 2;
|
||||
}
|
||||
message GetSubmissionsHistoryResponse {
|
||||
repeated HistorySubmission submissions = 1;
|
||||
}
|
||||
|
||||
message GetTaskAttachmentsRequest {
|
||||
string competition_id = 1;
|
||||
string task_id = 2;
|
||||
}
|
||||
message GetTaskAttachmentsResponse {
|
||||
repeated TaskAttachment attachments = 1;
|
||||
}
|
||||
|
||||
message GetCompetitionResultsRequest {
|
||||
string competition_id = 1;
|
||||
}
|
||||
message GetCompetitionResultsResponse {
|
||||
repeated TaskStatus results = 1;
|
||||
}
|
||||
|
||||
message Task {
|
||||
optional string id = 1;
|
||||
string competition = 2;
|
||||
string title = 3;
|
||||
string description = 4;
|
||||
int32 in_competition_position = 5;
|
||||
optional int32 points = 6;
|
||||
optional int32 max_attempts = 7;
|
||||
TaskType type = 8;
|
||||
TaskStatusEnum status = 9;
|
||||
}
|
||||
|
||||
enum TaskType {
|
||||
TASK_TYPE_UNSPECIFIED = 0;
|
||||
TASK_TYPE_INPUT = 1;
|
||||
TASK_TYPE_CHECKER = 2;
|
||||
TASK_TYPE_REVIEW = 3;
|
||||
}
|
||||
|
||||
enum TaskStatusEnum {
|
||||
TASK_STATUS_UNSPECIFIED = 0;
|
||||
TASK_STATUS_NOT_SUBMITTED = 1;
|
||||
TASK_STATUS_SENT = 2;
|
||||
TASK_STATUS_CHECKING = 3;
|
||||
TASK_STATUS_CHECKED = 4;
|
||||
}
|
||||
|
||||
message HistorySubmission {
|
||||
optional string id = 1;
|
||||
TaskStatusEnum status = 2;
|
||||
optional int32 earned_points = 3;
|
||||
string timestamp = 4;
|
||||
string content = 5;
|
||||
}
|
||||
|
||||
message TaskAttachment {
|
||||
optional string id = 1;
|
||||
string file = 2;
|
||||
bool public = 3;
|
||||
}
|
||||
|
||||
message TaskStatus {
|
||||
string task_name = 1;
|
||||
int32 result = 2;
|
||||
int32 max_points = 3;
|
||||
int32 position = 4;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user