Files
Sharpbin/SharpbinV3.Server/Data/Entities/User.cs
T
whoswhip 14bbd9c762 feat: reporting apis; better rate limiting
refactor: change certain apis to be more REST like (e.g. DELETE /api/paste/{pasteId}/delete -> DELETE /api/paste/{pasteId}
2026-01-10 00:06:36 -05:00

28 lines
1.0 KiB
C#

using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
namespace SharpbinV3.Server.Data.Entities
{
[Index(nameof(UID))]
[Index(nameof(UUID), IsUnique = true)]
public sealed class User
{
public int? UID { get; set; }
[Key]
public required Guid UUID { get; set; } = Guid.CreateVersion7(); // uuid v7 includes timestamp
public required string Username { get; set; }
public required string PasswordHash { get; set; }
public string? Email { get; set; }
public string? DisplayName { get; set; }
public long? LastLogin { get; set; }
public int[] Roles { get; set; } = [0]; // 0 = regular user, 1 = moderator, 255 = admin
public int Visibility { get; set; } = 0; // 0 = public, 1 = unlisted, 2 = private
public List<Paste> Pastes { get; set; } = [];
public List<RefreshToken> RefreshTokens { get; set; } = [];
public List<Report> Reports { get; set; } = [];
public UserTotp? Totp { get; set; }
}
}