feat: add tournoment
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user