feat:
This commit is contained in:
parent
33856fdad2
commit
e6de2af416
3 changed files with 75 additions and 40 deletions
67
contest/v1/contest.proto
Normal file
67
contest/v1/contest.proto
Normal file
|
@ -0,0 +1,67 @@
|
|||
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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue