mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
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
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user