mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
feat: paste views; configuration validation; hmacsha256 method; enhance paste clean up serivce; paste view clean up service;
This commit is contained in:
@@ -8,7 +8,6 @@ namespace SharpbinV3.Server.Data.Entities
|
||||
[Index(nameof(ID), IsUnique = true)]
|
||||
[Index(nameof(AuthorUUID))]
|
||||
[Index(nameof(ExpiresAt))]
|
||||
[Index(nameof(Views))]
|
||||
[Index(nameof(Visibility))]
|
||||
public sealed class Paste
|
||||
{
|
||||
@@ -33,5 +32,7 @@ namespace SharpbinV3.Server.Data.Entities
|
||||
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
|
||||
|
||||
public List<PasteView> PasteViews { get; set; } = [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace SharpbinV3.Server.Data.Entities
|
||||
{
|
||||
[Index(nameof(PastePID), nameof(ViewerHash), IsUnique = true)]
|
||||
public class PasteView
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public int PastePID { get; set; }
|
||||
[MaxLength(64)]
|
||||
public string ViewerHash { get; set; } = null!;
|
||||
public long ViewedAt { get; set; } = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
||||
public Paste Paste { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user