This commit is contained in:
2026-10-11 14:59:59 +07:00
parent f668eb66bc
commit 5980a5385e
6 changed files with 123 additions and 33 deletions
+46 -25
View File
@@ -44,17 +44,17 @@ service EveningDetectiveServer {
rpc DeviceHeartbeat(DeviceHeartbeatReq) returns (DeviceHeartbeatRsp) {
option (google.api.http) = { post: "/api/devices/heartbeat" body: "*" };
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Устройства";
summary: "Обновить присутствие подключения браузера";
tags : "Устройства";
summary : "Обновить присутствие подключения браузера";
description: "Публичный endpoint. Контексты взаимоисключающие и проверяются сервером. В prod enabled=false без регистрации. UUID обозначает браузерный профиль, не физический телефон.";
security: {};
security : {};
};
}
rpc GetDevices(GetDevicesReq) returns (GetDevicesRsp) {
option (google.api.http) = { get: "/api/devices" };
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Устройства";
summary: "Получить устройства площадки";
tags : "Устройства";
summary : "Получить устройства площадки";
description: "Только venue; организатор, администратор или разработчик. Связь актуальна менее 60 секунд; подключения удаляются через 15 минут. Фильтр gameID оставляет только подключения указанной игры.";
};
}
@@ -2401,39 +2401,60 @@ message GameResultsPackageRsp {
}
message DeviceHeartbeatReq {
string deviceID = 1;
string connectionID = 2;
string deviceID = 1;
string connectionID = 2;
optional int32 organizerGameID = 3;
optional int32 teamID = 4;
string password = 5;
string screenID = 6;
string accessToken = 7;
optional int32 teamID = 4;
string password = 5;
string screenID = 6;
string accessToken = 7;
}
message DeviceHeartbeatRsp {
optional bool enabled = 1;
optional bool enabled = 1;
google.protobuf.Timestamp serverTime = 2;
}
message GetDevicesReq { optional int32 gameID = 1; }
message GetDevicesRsp {
repeated VenueDevice devices = 1;
repeated VenueDevice devices = 1;
google.protobuf.Timestamp serverTime = 2;
VenueWiFi wifi = 3; // Entire venue, independent of the game filter.
}
message VenueDevice {
string ID = 1;
string ID = 1;
google.protobuf.Timestamp firstSeenAt = 2;
google.protobuf.Timestamp lastSeenAt = 3;
bool connected = 4;
google.protobuf.Timestamp lastSeenAt = 3;
bool connected = 4;
repeated DeviceConnection connections = 5;
}
message DeviceConnection {
string ID = 1;
string ID = 1;
google.protobuf.Timestamp firstSeenAt = 2;
google.protobuf.Timestamp lastSeenAt = 3;
string IP = 4;
string userAgent = 5;
bool connected = 6;
optional int32 gameID = 7;
optional int32 teamID = 8;
optional int32 screenID = 9;
string kind = 10; // browser, organizer, team, screen
google.protobuf.Timestamp lastSeenAt = 3;
string IP = 4;
string userAgent = 5;
bool connected = 6;
optional int32 gameID = 7;
optional int32 teamID = 8;
optional int32 screenID = 9;
string kind = 10; // browser, organizer, team, screen
}
message VenueWiFi {
bool enabled = 1;
google.protobuf.Timestamp collectedAt = 2;
bool stale = 3;
bool hasError = 4;
repeated WiFiClient clients = 5;
}
message WiFiClient {
string IP = 1;
string MAC = 2;
string band = 3;
optional int32 signal = 4; // dBm; absent when the router does not report it.
}