mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
refactor(channelserver): introduce repository interfaces for all 21 repos
Replace concrete pointer types on the Server struct with interfaces to decouple handlers from PostgreSQL implementations. This enables mock/stub injection for unit tests and opens the door to alternative storage backends (SQLite, in-memory). Also adds 9 missing repo initializations to SetTestDB() (event, achievement, shop, cafe, goocoo, diva, misc, scenario, mercenary) to match NewServer().
This commit is contained in:
@@ -395,4 +395,13 @@ func SetTestDB(s *Server, db *sqlx.DB) {
|
||||
s.stampRepo = NewStampRepository(db)
|
||||
s.distRepo = NewDistributionRepository(db)
|
||||
s.sessionRepo = NewSessionRepository(db)
|
||||
s.eventRepo = NewEventRepository(db)
|
||||
s.achievementRepo = NewAchievementRepository(db)
|
||||
s.shopRepo = NewShopRepository(db)
|
||||
s.cafeRepo = NewCafeRepository(db)
|
||||
s.goocooRepo = NewGoocooRepository(db)
|
||||
s.divaRepo = NewDivaRepository(db)
|
||||
s.miscRepo = NewMiscRepository(db)
|
||||
s.scenarioRepo = NewScenarioRepository(db)
|
||||
s.mercenaryRepo = NewMercenaryRepository(db)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user