1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-19 06:05:22 +08:00
osu-lazer/osu.Game/Online/API/Requests/CommentReportRequest.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1.2 KiB
C#
Raw Normal View History

2022-10-14 21:15:28 +08:00
// 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.Net.Http;
using osu.Framework.IO.Network;
using osu.Game.Overlays.Comments;
namespace osu.Game.Online.API.Requests
{
public class CommentReportRequest : APIRequest
{
public readonly long CommentID;
public readonly CommentReportReason Reason;
2022-10-17 01:14:05 +08:00
public readonly string Comment;
2022-10-14 21:15:28 +08:00
2022-10-17 01:14:05 +08:00
public CommentReportRequest(long commentID, CommentReportReason reason, string comment)
2022-10-14 21:15:28 +08:00
{
CommentID = commentID;
Reason = reason;
2022-10-17 01:14:05 +08:00
Comment = comment;
2022-10-14 21:15:28 +08:00
}
protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
req.Method = HttpMethod.Post;
req.AddParameter(@"reportable_type", @"comment");
req.AddParameter(@"reportable_id", $"{CommentID}");
req.AddParameter(@"reason", Reason.ToString());
2022-10-17 01:14:05 +08:00
req.AddParameter(@"comments", Comment);
2022-10-14 21:15:28 +08:00
return req;
}
protected override string Target => @"reports";
}
}