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:
Houmgaor
2026-02-24 16:07:37 +01:00
parent 76d139538b
commit 7a56810e78
8 changed files with 322 additions and 56 deletions

View File

@@ -210,7 +210,6 @@ type TowerRepo interface {
UpdateProgress(charID uint32, tr, trp, cost, block1 int32) error
GetGems(charID uint32) (string, error)
UpdateGems(charID uint32, gems string) error
AddGem(charID uint32, gemIndex int, quantity int) error
GetTenrouiraiProgress(guildID uint32) (TenrouiraiProgressData, error)
GetTenrouiraiMissionScores(guildID uint32, missionIndex uint8) ([]TenrouiraiCharScore, error)
GetGuildTowerRP(guildID uint32) (uint32, error)