This commit is contained in:
2026-10-23 00:45:30 +07:00
parent 60119a07e8
commit 146700cf4c
34 changed files with 622 additions and 124 deletions
+9
View File
@@ -77,6 +77,8 @@ func (r *GamesRepo) GetGameByID(
games.scenario_id,
games.started_at,
games.ended_at,
games.wifi_name,
games.wifi_password,
(SELECT
CASE WHEN e.released_at IS NOT NULL OR EXISTS (
SELECT 1
@@ -105,6 +107,8 @@ func (r *GamesRepo) GetGameByID(
&game.ScenarioID,
&game.StartedAt,
&game.EndedAt,
&game.WiFiName,
&game.WiFiPassword,
&game.Export,
)
if err != nil {
@@ -207,6 +211,7 @@ func (r *GamesRepo) UpdateGame(
startAt time.Time,
scenarioID int32,
format string,
wifiName, wifiPassword *string,
) error {
tag, err := r.pool.Exec(
ctx,
@@ -218,6 +223,8 @@ func (r *GamesRepo) UpdateGame(
start_at = $4,
scenario_id = $5,
format = $6,
wifi_name = COALESCE($8, wifi_name),
wifi_password = COALESCE($9, wifi_password),
updated_at = NOW()
WHERE id = $7`,
name,
@@ -227,6 +234,8 @@ func (r *GamesRepo) UpdateGame(
scenarioID,
format,
id,
wifiName,
wifiPassword,
)
if err != nil {
return err