mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Add PaginatedWebRequest to handle request pagination
This commit is contained in:
@ -7,23 +7,20 @@ using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class GetUserBeatmapsRequest : APIRequest<List<APIBeatmapSet>>
|
||||
public class GetUserBeatmapsRequest : PaginatedAPIRequest<List<APIBeatmapSet>>
|
||||
{
|
||||
private readonly long userId;
|
||||
private readonly int offset;
|
||||
private readonly int limit;
|
||||
|
||||
private readonly BeatmapSetType type;
|
||||
|
||||
public GetUserBeatmapsRequest(long userId, BeatmapSetType type, int offset = 0, int limit = 6)
|
||||
: base(offset, limit)
|
||||
{
|
||||
this.userId = userId;
|
||||
this.offset = offset;
|
||||
this.limit = limit;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
|
||||
protected override string Target => $@"users/{userId}/beatmapsets/{type.ToString().Underscore()}?offset={offset}&limit={limit}";
|
||||
protected override string Target => $@"users/{userId}/beatmapsets/{type.ToString().Underscore()}";
|
||||
}
|
||||
|
||||
public enum BeatmapSetType
|
||||
|
Reference in New Issue
Block a user