feat: add cards templete

This commit is contained in:
2026-06-24 10:47:54 +03:30
parent 60494946d6
commit b1c7bfdd06
124 changed files with 422 additions and 30 deletions
+6 -1
View File
@@ -16,6 +16,7 @@ import (
"hakemsho/internal/config"
"hakemsho/internal/economy"
"hakemsho/internal/httpx"
"hakemsho/internal/static"
"hakemsho/internal/store"
"hakemsho/internal/user"
"hakemsho/internal/ws"
@@ -80,8 +81,11 @@ func main() {
// WebSocket بازی (احراز هویت با توکن در ?token= یا هدر Authorization)
r.Get("/ws", hub.ServeWS)
// تصاویرِ کارت (هر اسکین یک پوشه) — از backend سرویس می‌شود تا اپ سبک بماند.
r.Handle("/cards/*", static.CardsHandler(cfg.CardsDir))
// پنل ادمین (HTML سرور‌ساید، پشت Basic Auth)
r.Mount("/admin", admin.New(st.DB, eco).Routes(cfg.AdminUser, cfg.AdminPass))
r.Mount("/admin", admin.New(st.DB, eco, cfg.CardsDir).Routes(cfg.AdminUser, cfg.AdminPass))
r.Route("/api", func(r chi.Router) {
r.Route("/auth", func(r chi.Router) {
@@ -97,6 +101,7 @@ func main() {
// کیف‌پول و فروشگاه
r.Get("/wallet", ecoH.Wallet)
r.Get("/stats", ecoH.Stats)
r.Get("/leaderboard", ecoH.Leaderboard)
r.Get("/tables/info", ecoH.TablesInfo)
r.Get("/shop", ecoH.Shop)
r.Post("/shop/buy-card", ecoH.BuyCard)