feat: paste creation, utilities, revert to gzip, grammar fixes etc

This commit is contained in:
2025-11-25 01:17:16 -05:00
parent 6ec1a7fa7b
commit 93daa2e1a2
19 changed files with 949 additions and 23 deletions
+11 -5
View File
@@ -9,23 +9,29 @@ namespace SharpbinV3.Data.Entities
[Index(nameof(AuthorUUID))]
[Index(nameof(ExpiresAt))]
[Index(nameof(Views))]
[Index(nameof(Visiblity))]
[Index(nameof(Visibility))]
public sealed class Paste
{
[Key]
public int PID { get; set; }
public required string UUID { get; set; } // uuid v7 includes timestamp, this counts as created at
public required Guid UUID { get; set; } // uuid v7 includes timestamp, this counts as created at
public required string ID { get; set; }
public string? Title { get; set; }
public required string AuthorUUID { get; set; } // uuid of the user who created the paste, or "ANON" for anonymous pastes
public required Guid AuthorUUID { get; set; } = Guid.Empty; // uuid of the user who created the paste, or Guid.Empty for anonymous pastes
public User? User { get; set; }
public required string FilePath { get; set; }
public long? EditedAt { get; set; }
public required byte[] Content { get; set; }
public int Size { get; set; } // stored size (may be compressed)
public int TrueSize { get; set; } // uncompressed size
public bool IsCompressed { get; set; } = false;
public int Views { get; set; }
public string? Syntax { get; set; }
public int Visiblity { get; set; } = 0; // 0 = public, 1 = unlisted, 2 = private
public int Visibility { get; set; } = 0; // 0 = public, 1 = unlisted, 2 = private (encrypted pastes handled on frontend)
public long ExpiresAt { get; set; } // timestamp of when the paste expires, or 0 for never
}
}