feat: add tournoment

This commit is contained in:
2026-07-07 15:17:33 +03:30
parent bcfaf35d73
commit e58c50d6e5
10 changed files with 744 additions and 1 deletions
+14
View File
@@ -172,9 +172,23 @@ func main() {
r.Post("/shop/purchase", ecoH.Purchase)
r.Post("/rewards/daily", ecoH.Daily)
r.Post("/rewards/ad", ecoH.AdReward)
// تورنومنت‌ها
r.Get("/tournaments", ecoH.Tournaments)
r.Get("/tournaments/standings", ecoH.TournamentStandings)
r.Post("/tournaments/join", ecoH.JoinTournament)
})
})
// تسویه‌ی خودکارِ تورنومنت‌های پایان‌یافته (هر دقیقه).
go func() {
t := time.NewTicker(time.Minute)
defer t.Stop()
for range t.C {
eco.SettleTournaments(context.Background())
}
}()
srv := &http.Server{
Addr: cfg.Addr,
Handler: r,