80 lines
1.5 KiB
Protocol Buffer
80 lines
1.5 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
import "proto/users.proto";
|
|
import "proto/maps.proto";
|
|
import "proto/bots.proto";
|
|
|
|
option go_package = "pkg/rpc/times";
|
|
|
|
package times;
|
|
|
|
service TimesService {
|
|
rpc Create(TimeRequest) returns (IdMessage);
|
|
rpc Update(TimeRequest) returns (NullResponse);
|
|
rpc Delete(IdMessage) returns (NullResponse);
|
|
rpc Get(IdMessage) returns (TimeResponse);
|
|
rpc List(ListRequest) returns (TimeList);
|
|
rpc Rank(IdMessage) returns (RankResponse);
|
|
}
|
|
|
|
message TimeRequest {
|
|
int64 ID = 1;
|
|
optional int64 Time = 2;
|
|
optional int64 UserID = 3;
|
|
optional int64 MapID = 4;
|
|
optional int64 Date = 5;
|
|
optional int32 StyleID = 6;
|
|
optional int32 ModeID = 7;
|
|
optional int32 GameID = 8;
|
|
}
|
|
|
|
message TimeFilter {
|
|
optional int64 ID = 1;
|
|
optional int64 Time = 2;
|
|
optional int64 UserID = 3;
|
|
optional int64 MapID = 4;
|
|
optional int64 Date = 5;
|
|
optional int32 StyleID = 6;
|
|
optional int32 ModeID = 7;
|
|
optional int32 GameID = 8;
|
|
}
|
|
|
|
message TimeResponse {
|
|
int64 ID = 1;
|
|
int64 Time = 2;
|
|
users.UserResponse User = 3;
|
|
maps.MapResponse Map = 4;
|
|
optional bots.BotResponse Bot = 5;
|
|
int64 Date = 6;
|
|
int32 StyleID = 7;
|
|
int32 ModeID = 8;
|
|
int32 GameID = 9;
|
|
}
|
|
|
|
message IdMessage {
|
|
int64 ID = 1;
|
|
}
|
|
|
|
message TimeList {
|
|
repeated TimeResponse Times = 1;
|
|
int64 Total = 2;
|
|
}
|
|
|
|
message RankResponse {
|
|
int64 Rank = 1;
|
|
}
|
|
|
|
message ListRequest {
|
|
TimeFilter Filter = 1;
|
|
bool Blacklisted = 2;
|
|
Pagination Page = 3;
|
|
}
|
|
|
|
message Pagination {
|
|
int32 Size = 1;
|
|
int32 Number = 2;
|
|
}
|
|
|
|
message NullResponse {
|
|
|
|
} |