Academatica.Api/Academatica.Api.Leaderboards/Controllers/LeaderboardsController.cs
/// <summary>
/// Endpoint used to receive information about the user's standing in the leaderboard.
/// </summary>
/// <param name="id">User ID.</param>
/// <returns>User league and position.</returns>
Endpoint used to receive information about the user's standing in the leaderboard.
Endpoint used to receive information about the user ' s standing in the leaderboard .
[HttpGet]
        [Route("{id}")]
        public async Task<IActionResult> GetUserLeaderboardStats([FromRoute] Guid id)
        {
            string league = await _leaderboardService.GetUserLeague(id.ToString());
            long position = await _leaderboardService.GetUserPosition(id.ToString());
            GetUserLeaderboardStatsResponseDto leaderboardStats = new GetUserLeaderboardStatsResponseDto()
            {
                League = league,
                Rank = position + 1
            };
            return Ok(leaderboardStats);
        }
[ HttpGet ] [ Route ( " " ) ] public async Task < IActionResult > GetUserLeaderboardStats ( [ FromRoute ] Guid id ) { string league = await _leaderboardService . GetUserLeague ( id . ToString ( ) ) ; long position = await _leaderboardService . GetUserPosition ( id . ToString ( ) ) ; GetUserLeaderboardStatsResponseDto leaderboardStats = new GetUserLeaderboardStatsResponseDto ( ) { League = league , Rank = position + 1 } ; return Ok ( leaderboardStats ) ; }
Endpoint used to receive information about the user's standing in the leaderboard.
Endpoint used to receive information about the user ' s standing in the leaderboard .
User league and position.
User league and position .
Guid
[FromRoute]
id
None