mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-05 18:48:41 +00:00
this is a LOT, i should've commited in stages but oh well, from what i can remember:
- paste interactions (reactions)
- comments
- comment interactions (reactions)
- rich text editor
- move all report apis into report controller
- rename size to sizeStored
- rename trueSize to originalSize
- fixed compression on paste compression
- implemented compression threshold
- use longs instead of ints where possible in the entities
- improve record view + remove redundant check for existing view
57 lines
1.3 KiB
C#
57 lines
1.3 KiB
C#
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
|
|
{
|
|
[Key]
|
|
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 long? PastePID { get; set; }
|
|
public Guid? UserUUID { get; set; }
|
|
public long? CommentID { get; set; }
|
|
|
|
public Paste? Paste { get; set; }
|
|
public User? User { get; set; }
|
|
}
|
|
|
|
|
|
public enum ReportStatus
|
|
{
|
|
Open,
|
|
Closed
|
|
}
|
|
public enum ReportType
|
|
{
|
|
CopyrightViolation,
|
|
IllegalContent,
|
|
Fraud,
|
|
Other
|
|
}
|
|
public enum ReportTargetType
|
|
{
|
|
Paste,
|
|
User,
|
|
Comment
|
|
|
|
}
|
|
}
|