mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-25 09:03:10 +01:00
refactor(channelserver): extract StampRepository, DistributionRepository, and SessionRepository
Eliminate 18 direct s.server.db calls from handlers_items.go, handlers_distitem.go, and handlers_session.go by moving queries into dedicated repository types. New repositories: - StampRepository (7 methods, stamps table) - DistributionRepository (4 methods, distribution/distribution_items) - SessionRepository (4 methods, sign_sessions/servers) Also adds ClearTreasureHunt and InsertKillLog to GuildRepository, which already owns those tables for read operations.
This commit is contained in:
@@ -55,6 +55,9 @@ type Server struct {
|
||||
towerRepo *TowerRepository
|
||||
rengokuRepo *RengokuRepository
|
||||
mailRepo *MailRepository
|
||||
stampRepo *StampRepository
|
||||
distRepo *DistributionRepository
|
||||
sessionRepo *SessionRepository
|
||||
erupeConfig *_config.Config
|
||||
acceptConns chan net.Conn
|
||||
deleteConns chan net.Conn
|
||||
@@ -134,6 +137,9 @@ func NewServer(config *Config) *Server {
|
||||
s.towerRepo = NewTowerRepository(config.DB)
|
||||
s.rengokuRepo = NewRengokuRepository(config.DB)
|
||||
s.mailRepo = NewMailRepository(config.DB)
|
||||
s.stampRepo = NewStampRepository(config.DB)
|
||||
s.distRepo = NewDistributionRepository(config.DB)
|
||||
s.sessionRepo = NewSessionRepository(config.DB)
|
||||
|
||||
// Mezeporta
|
||||
s.stages["sl1Ns200p0a0u0"] = NewStage("sl1Ns200p0a0u0")
|
||||
|
||||
Reference in New Issue
Block a user