Files
whoswhip 63b77bece9 feat: comments & paste/comment reactions; renames/refactors
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
2026-04-24 08:52:33 -04:00

38 lines
1.3 KiB
C#

using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace SharpbinV3.Server.Data.Entities
{
public class Comment
{
[Key]
public long Id { get; set; }
public long PastePID { get; set; }
public long? ParentCommentID { get; set; }
[MaxLength(5000)]
public byte[]? Content { get; set; } = null!; // compressed & decompressed server side, if deleted then null
public long StoredSize { get; set; }
public long OriginalSize { get; set; }
public bool IsCompressed { get; set; } = false;
public Guid UserUUID { get; set; }
public long CreatedAt { get; set; } = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
public long? UpdatedAt { get; set; }
public Paste Paste { get; set; } = null!;
public User User { get; set; } = null!;
public Comment? ParentComment { get; set; }
public List<CommentInteraction> Interactions { get; set; } = [];
public List<Comment> Replies { get; set; } = [];
public List<Report> Reports { get; set; } = [];
[NotMapped]
public int PositiveInteractionCount { get; set; }
[NotMapped]
public int NegativeInteractionCount { get; set; }
}
}