public Rankings GetUserRanks(
     long userId,
     Leaderboard.Type type,
     Leaderboard.Range range,
     Leaderboard.TimeSpan timeSpan,
     int page,
     int limit)
 {
     throw new NotImplementedException();
 }
Beispiel #2
0
        public IHttpActionResult GetUsersLeaderboard(
            [FromUri] Leaderboard.Type type         = Leaderboard.Type.Shares,
            [FromUri] Leaderboard.Range range       = Leaderboard.Range.Global,
            [FromUri] Leaderboard.TimeSpan timeSpan = Leaderboard.TimeSpan.AllTime,
            [FromUri] int?companyId = null,
            [FromUri] int page      = 1,
            [FromUri] int limit     = 20)
        {
            if (!Session.Authorized)
            {
                return(Unauthorized());
            }

            var leaderboard = range == Leaderboard.Range.Company
                ? _leaderboardsRepo.GetUsersCompanyLeaderboard(companyId, type, timeSpan, page, limit)
                : _leaderboardsRepo.GetUsersGlobalLeaderboard(type, timeSpan, page, limit);


            return(Ok(leaderboard));
        }
Beispiel #3
0
        public IHttpActionResult GetCompaniesLeaderboard(
            [FromUri] Leaderboard.Type?type         = null,
            [FromUri] Leaderboard.Range range       = Leaderboard.Range.Global,
            [FromUri] Leaderboard.TimeSpan timeSpan = Leaderboard.TimeSpan.AllTime,
            [FromUri] int page  = 1,
            [FromUri] int limit = 20)
        {
            if (!Session.Authorized)
            {
                return(Unauthorized());
            }

            if (type == null)
            {
                return(BadRequest("Campo Type mancante"));
            }

            var data = type + " " + range + " " + timeSpan;

            return(Ok());
        }