53 lines
1.2 KiB
Protocol Buffer
53 lines
1.2 KiB
Protocol Buffer
syntax = "proto3";
|
|
package competition;
|
|
|
|
option go_package = "pkg/api/competition";
|
|
|
|
service CompetitionService {
|
|
rpc GetCompetition(GetCompetitionRequest) returns (GetCompetitionResponse);
|
|
rpc ListCompetitions(ListCompetitionsRequest) returns (ListCompetitionsResponse);
|
|
rpc ChangeCompetitionState(ChangeCompetitionStateRequest) returns (ChangeCompetitionStateResponse);
|
|
}
|
|
|
|
message GetCompetitionRequest {
|
|
string competition_id = 1;
|
|
}
|
|
message GetCompetitionResponse {
|
|
Competition competition = 1;
|
|
}
|
|
|
|
message ListCompetitionsRequest {
|
|
bool is_participating = 1;
|
|
}
|
|
message ListCompetitionsResponse {
|
|
repeated Competition competitions = 1;
|
|
}
|
|
|
|
message ChangeCompetitionStateRequest {
|
|
string competition_id = 1;
|
|
CompetitionState state = 2;
|
|
}
|
|
message ChangeCompetitionStateResponse {
|
|
CompetitionState state = 1;
|
|
}
|
|
|
|
message Competition {
|
|
string id = 1;
|
|
CompetitionState state = 2;
|
|
string title = 3;
|
|
string description = 4;
|
|
optional string image_url = 5;
|
|
optional string end_date = 6;
|
|
optional string start_date = 7;
|
|
string type = 8;
|
|
string participation_type = 9;
|
|
}
|
|
|
|
enum CompetitionState {
|
|
COMPETITION_STATE_UNSPECIFIED = 0;
|
|
COMPETITION_STATE_NOT_STARTED = 1;
|
|
COMPETITION_STATE_STARTED = 2;
|
|
COMPETITION_STATE_FINISHED = 3;
|
|
}
|
|
|