refactor:
This commit is contained in:
parent
ad8d145986
commit
3c0f01630f
29 changed files with 360 additions and 1377 deletions
62
proto/tester/v1/tester.proto
Normal file
62
proto/tester/v1/tester.proto
Normal file
|
@ -0,0 +1,62 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package proto.tester.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
service TesterService {
|
||||
rpc CreateProblem (CreateProblemRequest) returns (CreateProblemResponse);
|
||||
rpc ReadProblem (ReadProblemRequest) returns (ReadProblemResponse);
|
||||
rpc UpdateProblem (UpdateProblemRequest) returns (google.protobuf.Empty);
|
||||
rpc DeleteProblem (DeleteProblemRequest) returns (google.protobuf.Empty);
|
||||
}
|
||||
|
||||
message CreateProblemRequest {
|
||||
message Problem {
|
||||
string name = 1;
|
||||
string description = 2;
|
||||
int32 time_limit = 3;
|
||||
int32 memory_limit = 4;
|
||||
}
|
||||
string token = 1;
|
||||
Problem problem = 2;
|
||||
}
|
||||
message CreateProblemResponse {
|
||||
int32 id = 1;
|
||||
}
|
||||
|
||||
message ReadProblemRequest {
|
||||
string token = 1;
|
||||
int32 id = 2;
|
||||
}
|
||||
message ReadProblemResponse {
|
||||
message Problem {
|
||||
int32 id = 1;
|
||||
string name = 2;
|
||||
string description = 3;
|
||||
int32 time_limit = 4;
|
||||
int32 memory_limit = 5;
|
||||
google.protobuf.Timestamp created_at = 6;
|
||||
google.protobuf.Timestamp updated_at = 7;
|
||||
}
|
||||
string token = 1;
|
||||
Problem problem = 2;
|
||||
}
|
||||
|
||||
message UpdateProblemRequest {
|
||||
message Problem {
|
||||
int32 id = 1;
|
||||
optional string name = 2;
|
||||
optional string description = 3;
|
||||
optional int32 time_limit = 4;
|
||||
optional int32 memory_limit = 5;
|
||||
}
|
||||
string token = 1;
|
||||
Problem problem = 2;
|
||||
}
|
||||
|
||||
message DeleteProblemRequest {
|
||||
string token = 1;
|
||||
int32 id = 2;
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package proto.user.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
service UserService {
|
||||
rpc CreateUser (CreateUserRequest) returns (CreateUserResponse);
|
||||
}
|
||||
|
||||
enum Role {
|
||||
ROLE_SPECTATOR_UNSPECIFIED = 0;
|
||||
ROLE_PARTICIPANT = 1;
|
||||
ROLE_MODERATOR = 2;
|
||||
ROLE_ADMIN = 3;
|
||||
}
|
||||
|
||||
message CreateUserRequest {
|
||||
message User {
|
||||
string username = 1;
|
||||
string password = 2;
|
||||
optional string email = 3;
|
||||
optional google.protobuf.Timestamp expires_at = 4;
|
||||
optional Role role = 5;
|
||||
}
|
||||
|
||||
string token = 1;
|
||||
User user = 2;
|
||||
}
|
||||
message CreateUserResponse {
|
||||
int32 id = 1;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue