evening_detective/api/main.proto

68 lines
1.0 KiB
Protocol Buffer

syntax = "proto3";
package crabs.evening_detective;
import "google/api/annotations.proto";
option go_package = "pkg/proto";
service EveningDetective {
rpc Ping(PingReq) returns (PingRsp) {
option (google.api.http) = {
get: "/ping"
};
}
rpc AddTeams(AddTeamsReq) returns (AddTeamsRsp) {
option (google.api.http) = {
post: "/teams",
body: "*"
};
}
rpc GetTeams(GetTeamsReq) returns (GetTeamsRsp) {
option (google.api.http) = {
get: "/teams"
};
}
}
message PingReq {}
message PingRsp {}
message AddTeamsReq {
repeated Team teams = 1;
}
message Team {
string name = 1;
}
message AddTeamsRsp {
repeated TeamFull teams = 1;
}
message TeamFull {
int64 id = 1;
string name = 2;
string password = 3;
}
message GetTeamsReq {}
message GetTeamsRsp {
repeated TeamAdvanced teams = 1;
}
message TeamAdvanced {
int64 id = 1;
string name = 2;
int64 spendTime = 3;
repeated Application applications = 4;
}
message Application {
string name = 1;
}