67 lines
1.5 KiB
Protocol Buffer
67 lines
1.5 KiB
Protocol Buffer
|
syntax = "proto3";
|
||
|
|
||
|
package contest.v1;
|
||
|
option go_package = "/contest/v1;contestv1";
|
||
|
|
||
|
import "google/protobuf/timestamp.proto";
|
||
|
import "google/protobuf/empty.proto";
|
||
|
|
||
|
service ContestService {
|
||
|
rpc CreateContest (CreateContestRequest) returns (CreateContestResponse);
|
||
|
rpc ReadContest (ReadContestRequest) returns (ReadContestResponse);
|
||
|
rpc DeleteContest (DeleteContestRequest) returns (google.protobuf.Empty);
|
||
|
|
||
|
rpc AddTask (AddTaskRequest) returns (AddTaskResponse);
|
||
|
rpc DeleteTask (DeleteTaskRequest) returns (google.protobuf.Empty);
|
||
|
|
||
|
rpc AddParticipant (AddParticipantRequest) returns (AddParticipantResponse);
|
||
|
rpc DeleteParticipant (DeleteParticipantRequest) returns (google.protobuf.Empty);
|
||
|
}
|
||
|
|
||
|
message CreateContestRequest {
|
||
|
string title = 1;
|
||
|
}
|
||
|
message CreateContestResponse {
|
||
|
int32 id = 1;
|
||
|
}
|
||
|
|
||
|
message ReadContestRequest {
|
||
|
int32 id = 1;
|
||
|
}
|
||
|
message ReadContestResponse {
|
||
|
message Contest {
|
||
|
int32 id = 1;
|
||
|
string title = 2;
|
||
|
google.protobuf.Timestamp created_at = 3;
|
||
|
google.protobuf.Timestamp updated_at = 4;
|
||
|
}
|
||
|
Contest contest = 1;
|
||
|
}
|
||
|
|
||
|
message DeleteContestRequest {
|
||
|
int32 id = 1;
|
||
|
}
|
||
|
|
||
|
message AddTaskRequest {
|
||
|
int32 contest_id = 1;
|
||
|
int32 problem_id = 2;
|
||
|
}
|
||
|
message AddTaskResponse {
|
||
|
int32 id = 1;
|
||
|
}
|
||
|
|
||
|
message DeleteTaskRequest {
|
||
|
int32 task_id = 1;
|
||
|
}
|
||
|
|
||
|
message AddParticipantRequest {
|
||
|
int32 contest_id = 1;
|
||
|
int32 user_id = 2;
|
||
|
}
|
||
|
message AddParticipantResponse {
|
||
|
int32 id = 1;
|
||
|
}
|
||
|
|
||
|
message DeleteParticipantRequest {
|
||
|
int32 participant_id = 1;
|
||
|
}
|