Compare commits
3 Commits
master
...
maps-field
Author | SHA1 | Date | |
---|---|---|---|
67fb7fc74e
|
|||
bbfa1cad3b
|
|||
1f5668308c
|
36
dev.proto
36
dev.proto
@ -1,36 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "git.itzana.me/strafesnet/go-grpc/dev";
|
||||
|
||||
package dev;
|
||||
|
||||
service DevService {
|
||||
rpc Validate(APIValidationRequest) returns (APIValidationResponse);
|
||||
}
|
||||
|
||||
message APIValidationRequest {
|
||||
string Service = 1;
|
||||
string Permission = 2;
|
||||
string Key = 3;
|
||||
string IP = 4;
|
||||
string Resource = 5;
|
||||
}
|
||||
|
||||
message APIValidationResponse {
|
||||
// Response
|
||||
bool Valid = 1;
|
||||
string ErrorMessage = 2;
|
||||
int32 StatusCode = 3;
|
||||
// Remaining limits
|
||||
uint64 RemainingBurst = 4;
|
||||
uint64 RemainingDaily = 5;
|
||||
uint64 RemainingMonthly = 6;
|
||||
// Quota
|
||||
uint64 BurstLimit = 7;
|
||||
uint64 BurstDurationSeconds = 8;
|
||||
uint64 DailyLimit = 9;
|
||||
uint64 MonthlyLimit = 10;
|
||||
// Owner info
|
||||
uint64 UserID = 11;
|
||||
string Application = 12;
|
||||
}
|
10
maps.proto
10
maps.proto
@ -27,6 +27,11 @@ message MapResponse {
|
||||
string Creator = 3;
|
||||
int32 GameID = 4;
|
||||
int64 Date = 5;
|
||||
int64 CreatedAt = 6;
|
||||
int64 UpdatedAt = 7;
|
||||
int64 Submitter = 8;
|
||||
int64 Thumbnail = 9;
|
||||
int64 AssetVersion = 10;
|
||||
}
|
||||
|
||||
message MapRequest {
|
||||
@ -35,12 +40,14 @@ message MapRequest {
|
||||
optional string Creator = 3;
|
||||
optional int32 GameID = 4;
|
||||
optional int64 Date = 5;
|
||||
optional int64 Submitter = 6;
|
||||
}
|
||||
|
||||
message MapFilter {
|
||||
optional string DisplayName = 2;
|
||||
optional string Creator = 3;
|
||||
optional int32 GameID = 4;
|
||||
optional int64 Submitter = 5;
|
||||
}
|
||||
|
||||
message MapList {
|
||||
@ -58,5 +65,4 @@ message Pagination {
|
||||
}
|
||||
|
||||
message NullResponse {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ do
|
||||
--tonic_out=$module \
|
||||
$f
|
||||
#I couldn't figure out how to configure protoc to do this
|
||||
sed -i "s/, PartialEq, ::prost::Message)\]/, PartialEq, ::prost::Message, serde::Serialize, serde::Deserialize)\]\n#\[serde(rename_all = \"PascalCase\")\]/g" "$module/$name.rs"
|
||||
sed -i "s/#\[derive(Clone, PartialEq, ::prost::Message)\]/#\[derive(Clone, PartialEq, ::prost::Message, serde::Serialize, serde::Deserialize)\]\n#\[serde(rename_all = \"PascalCase\")\]/g" "$module/$name.rs"
|
||||
sed -i "s/ pub id:/ #\[serde(rename = \"ID\")\]\n pub id:/g" "$module/$name.rs"
|
||||
sed -i "s/ pub map_id:/ #\[serde(rename = \"MapID\")\]\n pub map_id:/g" "$module/$name.rs"
|
||||
sed -i "s/ pub time_id:/ #\[serde(rename = \"TimeID\")\]\n pub time_id:/g" "$module/$name.rs"
|
||||
|
16
times.proto
16
times.proto
@ -14,9 +14,7 @@ service TimesService {
|
||||
rpc Delete(IdMessage) returns (NullResponse);
|
||||
rpc Get(IdMessage) returns (TimeResponse);
|
||||
rpc List(ListRequest) returns (TimeList);
|
||||
rpc ListWr(WrListRequest) returns (TimeList);
|
||||
rpc Rank(IdMessage) returns (RankResponse);
|
||||
rpc RankBatch(IdListMessage) returns (RankListResponse);
|
||||
}
|
||||
|
||||
message TimeRequest {
|
||||
@ -57,22 +55,13 @@ message IdMessage {
|
||||
int64 ID = 1;
|
||||
}
|
||||
|
||||
message IdListMessage {
|
||||
repeated int64 ID = 1;
|
||||
}
|
||||
|
||||
message TimeList {
|
||||
repeated TimeResponse Times = 1;
|
||||
int64 Total = 2;
|
||||
}
|
||||
|
||||
message RankListResponse {
|
||||
repeated RankResponse Ranks = 1;
|
||||
}
|
||||
|
||||
message RankResponse {
|
||||
int64 Rank = 1;
|
||||
int64 ID = 2;
|
||||
}
|
||||
|
||||
message ListRequest {
|
||||
@ -88,11 +77,6 @@ message ListRequest {
|
||||
uint32 Sort = 4;
|
||||
}
|
||||
|
||||
message WrListRequest {
|
||||
TimeFilter Filter = 1;
|
||||
Pagination Page = 2;
|
||||
}
|
||||
|
||||
message Pagination {
|
||||
int32 Size = 1;
|
||||
int32 Number = 2;
|
||||
|
Reference in New Issue
Block a user