1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 02:22:56 +08:00

API implementation

This commit is contained in:
Andrei Zavatski 2020-02-04 16:04:06 +03:00
parent d627d2f74e
commit 37992e99f9
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,30 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.IO.Network;
using osu.Game.Rulesets;
namespace osu.Game.Online.API.Requests
{
public class GetSpotlightRankingsRequest : GetRankingsRequest<GetSpotlightRankingsResponse>
{
private readonly int spotlight;
public GetSpotlightRankingsRequest(RulesetInfo ruleset, int spotlight)
: base(ruleset, 1)
{
this.spotlight = spotlight;
}
protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
req.AddParameter("spotlight", spotlight.ToString());
return req;
}
protected override string TargetPostfix() => "charts";
}
}

View File

@ -0,0 +1,22 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using Newtonsoft.Json;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Users;
namespace osu.Game.Online.API.Requests
{
public class GetSpotlightRankingsResponse
{
[JsonProperty("ranking")]
public List<UserStatistics> Users;
[JsonProperty("spotlight")]
public APISpotlight Spotlight;
[JsonProperty("beatmapsets")]
public List<APIBeatmapSet> BeatmapSets;
}
}