Files
Swarm/DysonNetwork.Drive/Models/Account.cs

40 lines
998 B
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DysonNetwork.Drive.Models;
public class Account : ModelBase
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid();
[Required]
[MaxLength(256)]
public string Username { get; set; } = null!;
[Required]
[MaxLength(256)]
public string Email { get; set; } = null!;
[MaxLength(1024)]
public string? DisplayName { get; set; }
public bool IsActive { get; set; } = true;
public bool IsVerified { get; set; } = false;
// Navigation properties
public virtual ICollection<CloudFile> Files { get; set; } = new List<CloudFile>();
// Timestamps
public DateTimeOffset? LastLoginAt { get; set; }
// Methods
public bool HasPermission(Permission permission)
{
// TODO: Implement actual permission checking logic
return true;
}
}