Files
2026-10-29 11:34:35 +08:00

36 lines
1.1 KiB
C#

using FreeSql.DataAnnotations;
namespace MAX.Framework.Security;
[Table(Name = "wxxd.user_tokens")]
public sealed class UserToken
{
[Column(IsPrimary = true, IsIdentity = true)]
public long Id { get; set; }
[Column(StringLength = 64)]
public string TokenHash { get; set; } = "";
[Column(StringLength = 100)]
public string UserName { get; set; }
[Column(StringLength = 100)]
public string? DeviceId { get; set; }
[Column(StringLength = 100)]
public string? DeviceName { get; set; }
[Column(StringLength = 64)]
public string? Ip { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime LastUsedAt { get; set; }
public DateTime ExpiresAt { get; set; }
public bool Revoked { get; set; }
}
// Read-only mapping of the existing user table; never synchronize this projection.
[Table(Name = "wxxd.user", DisableSyncStructure = true)]
public sealed class TokenAccount
{
[Column(Name = "id", IsPrimary = true)]
public int Id { get; set; }
[Column(Name = "user_name")]
public string UserName { get; set; } = "";
[Column(Name = "nick_name")]
public string NickName { get; set; } = "";
}