mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
feat: reporting apis; better rate limiting
refactor: change certain apis to be more REST like (e.g. DELETE /api/paste/{pasteId}/delete -> DELETE /api/paste/{pasteId}
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace SharpbinV3.Server.Data.Entities
|
||||
{
|
||||
[Index(nameof(ReportID), IsUnique = true)]
|
||||
[Index(nameof(ReporterUUID))]
|
||||
[Index(nameof(TargetType))]
|
||||
[Index(nameof(PastePID))]
|
||||
[Index(nameof(UserUUID))]
|
||||
public class Report
|
||||
{
|
||||
public int? ReportID { get; set; }
|
||||
|
||||
public ReportType Type { get; set; }
|
||||
public ReportStatus Status { get; set; } = ReportStatus.Open;
|
||||
|
||||
[MaxLength(1000)]
|
||||
public string? Description { get; set; }
|
||||
|
||||
public long CreatedAt { get; set; } = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
|
||||
public long? UpdatedAt { get; set; }
|
||||
|
||||
public Guid ReporterUUID { get; set; }
|
||||
|
||||
public ReportTargetType TargetType { get; set; }
|
||||
public int? PastePID { get; set; }
|
||||
public Guid? UserUUID { get; set; }
|
||||
|
||||
public Paste? Paste { get; set; }
|
||||
public User? User { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public enum ReportStatus
|
||||
{
|
||||
Open,
|
||||
InProgress,
|
||||
Resolved,
|
||||
Closed
|
||||
}
|
||||
public enum ReportType
|
||||
{
|
||||
Spam,
|
||||
Abuse,
|
||||
InappropriateContent,
|
||||
CopyrightViolation,
|
||||
Fraud,
|
||||
Other
|
||||
}
|
||||
public enum ReportTargetType
|
||||
{
|
||||
Paste,
|
||||
User
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user