refactor(channelserver): extract GachaRepository and HouseRepository

Centralizes all gacha_shop/gacha_entries/gacha_items/gacha_stepup/gacha_box
table access into GachaRepository (15 methods) and all user_binary house
columns, warehouse, and titles table access into HouseRepository (17 methods).
Eliminates all direct DB calls from handlers_gacha.go and handlers_house.go.
This commit is contained in:
Houmgaor
2026-02-20 22:30:28 +01:00
parent ab9fd0bc9c
commit 93f28c721a
6 changed files with 496 additions and 217 deletions

View File

@@ -48,6 +48,8 @@ type Server struct {
charRepo *CharacterRepository
guildRepo *GuildRepository
userRepo *UserRepository
gachaRepo *GachaRepository
houseRepo *HouseRepository
erupeConfig *_config.Config
acceptConns chan net.Conn
deleteConns chan net.Conn
@@ -121,6 +123,8 @@ func NewServer(config *Config) *Server {
s.charRepo = NewCharacterRepository(config.DB)
s.guildRepo = NewGuildRepository(config.DB)
s.userRepo = NewUserRepository(config.DB)
s.gachaRepo = NewGachaRepository(config.DB)
s.houseRepo = NewHouseRepository(config.DB)
// Mezeporta
s.stages["sl1Ns200p0a0u0"] = NewStage("sl1Ns200p0a0u0")