feat: add cards templete
This commit is contained in:
@@ -176,6 +176,23 @@ func (h *Handler) TablesInfo(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
// Leaderboard — GET /api/leaderboard (جدولِ رتبهبندیِ فصل)
|
||||
func (h *Handler) Leaderboard(w http.ResponseWriter, r *http.Request) {
|
||||
if _, ok := uid(r); !ok {
|
||||
httpx.Error(w, http.StatusUnauthorized, "unauthorized")
|
||||
return
|
||||
}
|
||||
list, err := h.svc.Leaderboard(r.Context(), 50)
|
||||
if err != nil {
|
||||
httpx.Error(w, http.StatusInternalServerError, "server error")
|
||||
return
|
||||
}
|
||||
httpx.JSON(w, http.StatusOK, map[string]any{
|
||||
"season": h.svc.Season(r.Context()),
|
||||
"entries": list,
|
||||
})
|
||||
}
|
||||
|
||||
// Daily — POST /api/rewards/daily
|
||||
func (h *Handler) Daily(w http.ResponseWriter, r *http.Request) {
|
||||
id, ok := uid(r)
|
||||
|
||||
Reference in New Issue
Block a user