fix(gacha): log and skip gacha_items rows that fail to scan

Previously GetItemsForEntry/GetGuaranteedItems silently swallowed
StructScan errors, so misconfigured rows (item_type > 255 or
item_id/quantity > 65535) disappeared from rewards with no trace,
making config bugs hard to diagnose without a DB dump.

Pass a zap.Logger into GachaRepository and emit a Warn pointing at
the likely cause and the offending entry/gacha ID.
This commit is contained in:
Houmgaor
2026-04-06 17:48:12 +02:00
parent 05ea321d9e
commit 6fa07ae4ae
5 changed files with 22 additions and 11 deletions

View File

@@ -581,7 +581,7 @@ func createTestServerWithDB(t *testing.T, db *sqlx.DB) *Server {
server.charRepo = NewCharacterRepository(db)
server.guildRepo = NewGuildRepository(db)
server.userRepo = NewUserRepository(db)
server.gachaRepo = NewGachaRepository(db)
server.gachaRepo = NewGachaRepository(db, nil)
server.houseRepo = NewHouseRepository(db)
server.festaRepo = NewFestaRepository(db)
server.towerRepo = NewTowerRepository(db)