mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-26 09:33:02 +01:00
refactor(tower): extract tower logic into TowerService
The tower repo had business logic beyond simple CRUD: AddGem used a fetch-transform-save pattern, progress capping was inline in the handler, and RP donation orchestrated multiple repo calls with conditional page advancement. Move these into a new TowerService following the established service layer pattern.
This commit is contained in:
@@ -78,6 +78,11 @@ func ensureGachaService(s *Server) {
|
||||
s.gachaService = NewGachaService(s.gachaRepo, s.userRepo, s.charRepo, s.logger, 100000)
|
||||
}
|
||||
|
||||
// ensureTowerService wires the TowerService from the server's current repos.
|
||||
func ensureTowerService(s *Server) {
|
||||
s.towerService = NewTowerService(s.towerRepo, s.logger)
|
||||
}
|
||||
|
||||
// createMockSession creates a minimal Session for testing.
|
||||
// Imported from v9.2.x-stable and adapted for main.
|
||||
func createMockSession(charID uint32, server *Server) *Session {
|
||||
|
||||
Reference in New Issue
Block a user