This commit is contained in:
2026-10-11 13:47:22 +07:00
parent 6f2b63511c
commit 63f570aad1
17 changed files with 2038 additions and 247 deletions
+60
View File
@@ -41,6 +41,23 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
};
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 : "Обновить присутствие подключения браузера";
description: "Публичный endpoint. Контексты взаимоисключающие и проверяются сервером. В prod enabled=false без регистрации. UUID обозначает браузерный профиль, не физический телефон.";
security : {};
};
}
rpc GetDevices(GetDevicesReq) returns (GetDevicesRsp) {
option (google.api.http) = { get: "/api/devices" };
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags : "Устройства";
summary : "Получить устройства площадки";
description: "Только venue; организатор, администратор или разработчик. Связь актуальна менее 60 секунд; подключения удаляются через 15 минут. Фильтр gameID оставляет только подключения указанной игры.";
};
}
rpc GetTasks(GetTasksReq) returns (GetTasksRsp) {
option (google.api.http) = { get: "/api/tasks" };
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
@@ -2382,3 +2399,46 @@ message GameResultsPackageRsp {
string packageID = 2;
string appliedAt = 3;
}
message DeviceHeartbeatReq {
string deviceID = 1;
string connectionID = 2;
optional int32 organizerGameID = 3;
optional int32 teamID = 4;
string password = 5;
string screenID = 6;
string accessToken = 7;
}
message DeviceHeartbeatRsp {
optional bool enabled = 1;
google.protobuf.Timestamp serverTime = 2;
}
message GetDevicesReq { optional int32 gameID = 1; }
message GetDevicesRsp {
repeated VenueDevice devices = 1;
google.protobuf.Timestamp serverTime = 2;
}
message VenueDevice {
string ID = 1;
google.protobuf.Timestamp firstSeenAt = 2;
google.protobuf.Timestamp lastSeenAt = 3;
bool connected = 4;
repeated DeviceConnection connections = 5;
}
message DeviceConnection {
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
}