mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
33 lines
1.3 KiB
C#
33 lines
1.3 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();
|
|
public long CreatedAt { get; set; } = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
|
public required string Username { get; set; }
|
|
public required string PasswordHash { get; set; }
|
|
|
|
public string? Email { get; set; }
|
|
public bool EmailVerified { get; set; } = false;
|
|
|
|
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 List<ApiKey> ApiKeys { get; set; } = [];
|
|
public List<EmailVerificationToken> EmailVerificationTokens { get; set; } = [];
|
|
public UserTotp? Totp { get; set; }
|
|
}
|
|
}
|