public ActionResult <GetUserRecentRatingResponse> GetUserRecentRating(GetUserRecentRatingRequest request) { Guid?aimeId = _aimeService.FindIdByCardId(request.UserId); var profile = _context.FindProfileWithData(aimeId, p => p.PlayLogs); UserRecentRating[] logs = Array.Empty <UserRecentRating>(); if (profile != null) { _context.Profiles .Include(p => p.PlayLogs); logs = profile.PlayLogs .OrderByDescending(l => l.UserPlayDate) .Take(30) .Select(l => new UserRecentRating { MusicId = l.MusicId, DifficultId = l.Level, // game version not saved in play log, just return a fixed version now RomVersionCode = 1030000, Score = l.Score }) .ToArray(); } return(Ok(new GetUserRecentRatingResponse { UserId = request.UserId, Length = logs.Length, UserRecentRatingList = logs })); }
public ActionResult <GetUserRecentRatingResponse> GetUserRecentPlayer(GetUserRecentRatingRequest request) { return(GetUserRecentRating(request)); }