From 90871f920bb1a4905a6f4358828b5163f6d35fc6 Mon Sep 17 00:00:00 2001 From: Fedorov Vladimir Date: Mon, 21 Sep 2026 18:28:14 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20=D1=81=D1=82=D0=BE=D0=BB=20=D0=BE=D1=80=D0=B3=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B7=D0=B0=D1=82=D0=BE=D1=80=D0=BE=D0=B2=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BA=D0=B0=D1=80=D1=82=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/app/game_map.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/app/game_map.go b/internal/app/game_map.go index 4dcc6eb..1a5f125 100644 --- a/internal/app/game_map.go +++ b/internal/app/game_map.go @@ -22,6 +22,9 @@ func (s *server) GetGameMap(ctx context.Context, req *proto.GetGameMapReq) (*pro if err != nil { return nil, status.Error(codes.NotFound, "игра не найдена") } + if err := s.mapRepo.Ensure(ctx, int(req.GameId), "organizer_desk", 1); err != nil { + return nil, status.Error(codes.Internal, "не удалось сохранить карту") + } for _, team := range game.Teams { if team.ParticipationStatus == "cancelled" { continue @@ -67,6 +70,9 @@ func (s *server) GetGameMap(ctx context.Context, req *proto.GetGameMapReq) (*pro if item.Kind == "team" { mapped.Label = teamNames[item.ItemID] } + if item.Kind == "organizer_desk" { + mapped.Label = "Стол организаторов" + } if state := screenStates[item.ItemID]; item.Kind == "screen" && state != nil { mapped.Label = "Экран " + state.Id mapped.Status = state.Status @@ -81,7 +87,7 @@ func (s *server) UpdateGameMapItem(ctx context.Context, req *proto.UpdateGameMap if !canManageScreens(ctx) { return nil, status.Error(codes.PermissionDenied, "permission denied") } - if req == nil || req.GameId <= 0 || req.ItemId <= 0 || (req.Kind != "team" && req.Kind != "screen") { + if req == nil || req.GameId <= 0 || req.ItemId <= 0 || (req.Kind != "team" && req.Kind != "screen" && req.Kind != "organizer_desk") { return nil, status.Error(codes.InvalidArgument, "некорректный объект карты") } if err := s.mapRepo.Update(ctx, game_map_repo.Item{GameID: int(req.GameId), Kind: req.Kind, ItemID: int(req.ItemId), X: int(req.X), Y: int(req.Y), Hidden: req.Hidden}); err != nil {