2024-04-29 12:32:58 -07:00
|
|
|
// Copyright (C) 2024 Pagefault Games - All Rights Reserved
|
|
|
|
// https://github.com/pagefaultgames
|
|
|
|
|
2024-04-14 17:03:53 -07:00
|
|
|
package daily
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
|
2024-04-29 12:22:27 -07:00
|
|
|
"github.com/pagefaultgames/rogueserver/db"
|
|
|
|
"github.com/pagefaultgames/rogueserver/defs"
|
2024-04-14 17:03:53 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
// /daily/rankings - fetch daily rankings
|
2024-04-19 13:44:33 -07:00
|
|
|
func Rankings(category, page int) ([]defs.DailyRanking, error) {
|
2024-04-14 17:03:53 -07:00
|
|
|
rankings, err := db.FetchRankings(category, page)
|
|
|
|
if err != nil {
|
|
|
|
log.Print("failed to retrieve rankings")
|
|
|
|
}
|
|
|
|
|
|
|
|
return rankings, nil
|
|
|
|
}
|