Saving
This commit is contained in:
116
PrivaPub/Models/User/Avatar.cs
Normal file
116
PrivaPub/Models/User/Avatar.cs
Normal file
@ -0,0 +1,116 @@
|
||||
using MongoDB.Entities;
|
||||
|
||||
namespace PrivaPub.Models.User
|
||||
{
|
||||
public class Avatar : Entity
|
||||
{
|
||||
public string Url { get; set; }//url
|
||||
public string Name { get; set; }//name
|
||||
public string UserName { get; set; }//preferredUsername
|
||||
public string Biography { get; set; }//summary
|
||||
|
||||
public Dictionary<string, string> SharedPersonalContacts { get; set; } = new();
|
||||
public string PrivateKey { get; set; }
|
||||
public string PublicKey { get; set; }
|
||||
public AvatarAccountState AccountState { get; set; } = AvatarAccountState.Normal;
|
||||
public AvatarSettings Settings { get; set; } = new();
|
||||
public Dictionary<string, string> Fields { get; set; } = new();
|
||||
|
||||
public string Domain { get; set; }
|
||||
public string PersonalNote { get; set; }
|
||||
public string ModerationNote { get; set; }
|
||||
|
||||
public string InboxURL { get; set; }
|
||||
public string OutboxURL { get; set; }
|
||||
public string MovedToURL { get; set; }
|
||||
public string PictureURL { get; set; }//icon
|
||||
public string ThumbnailURL { get; set; }//image
|
||||
public AvatarType AvatarType { get; set; } = AvatarType.Person;
|
||||
public AvatarServer AvatarServer { get; set; } = AvatarServer.PrivaPub;
|
||||
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? SilencedAt { get; set; }
|
||||
public DateTime? SuspendedAt { get; set; }
|
||||
public DateTime? BannedAt { get; set; }
|
||||
public DateTime? DeletionAt { get; set; }
|
||||
}
|
||||
|
||||
public class ForeignAvatar : Entity
|
||||
{
|
||||
public string Url { get; set; }//url
|
||||
public string Name { get; set; }//name
|
||||
public string UserName { get; set; }//preferredUsername
|
||||
public string Biography { get; set; }//summary
|
||||
|
||||
public Dictionary<string, string> SharedPersonalContacts { get; set; } = new();
|
||||
public string PrivateKey { get; set; }
|
||||
public string PublicKey { get; set; }
|
||||
public AvatarAccountState AccountState { get; set; } = AvatarAccountState.Normal;
|
||||
public AvatarSettings Settings { get; set; } = new();
|
||||
public Dictionary<string, string> Fields { get; set; } = new();
|
||||
|
||||
public string Domain { get; set; }
|
||||
public string PersonalNote { get; set; }
|
||||
public string ModerationNote { get; set; }
|
||||
public bool IsDiscoverable { get; set; } = true;
|
||||
|
||||
public string InboxURL { get; set; }
|
||||
public string OutboxURL { get; set; }
|
||||
public string MovedToURL { get; set; }
|
||||
public string PictureURL { get; set; }//icon
|
||||
public string ThumbnailURL { get; set; }//image
|
||||
public AvatarType AvatarType { get; set; } = AvatarType.Person;
|
||||
public AvatarServer AvatarServer { get; set; } = AvatarServer.Unknown;
|
||||
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? SilencedAt { get; set; }
|
||||
public DateTime? SuspendedAt { get; set; }
|
||||
public DateTime? BannedAt { get; set; }
|
||||
public DateTime? DeletionAt { get; set; }
|
||||
}
|
||||
|
||||
public class AvatarSettings
|
||||
{
|
||||
public string LanguageCode { get; set; } = "en-GB";
|
||||
|
||||
public bool IsDefault { get; set; } = true;
|
||||
|
||||
public short IconsThemeIndexColour { get; set; } = 25;
|
||||
public short LightThemeIndexColour { get; set; } = 25;
|
||||
public short DarkThemeIndexColour { get; set; } = 215;
|
||||
public bool PreferSystemTheming { get; set; } = true;
|
||||
public bool ThemeIsDarkMode { get; set; } = false;
|
||||
public bool ThemeIsDarkGray { get; set; } = false;
|
||||
public bool ThemeIsLightGray { get; set; } = true;
|
||||
}
|
||||
|
||||
public enum AvatarServer
|
||||
{
|
||||
Unknown,
|
||||
Pleroma,
|
||||
Mastodon,
|
||||
Akkoma,
|
||||
Misskey,
|
||||
PrivaPub
|
||||
}
|
||||
|
||||
public enum AvatarType
|
||||
{
|
||||
Application,
|
||||
Group,
|
||||
Organization,
|
||||
Person,
|
||||
Service
|
||||
}
|
||||
|
||||
public enum AvatarAccountState
|
||||
{
|
||||
Normal,
|
||||
Silenced,
|
||||
Suspended,
|
||||
Banned,
|
||||
Deleted
|
||||
}
|
||||
}
|
12
PrivaPub/Models/User/EmailRecovery.cs
Normal file
12
PrivaPub/Models/User/EmailRecovery.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using MongoDB.Entities;
|
||||
|
||||
namespace PrivaPub.Models.User
|
||||
{
|
||||
public class EmailRecovery : Entity
|
||||
{
|
||||
public string RootUserId { get; set; }
|
||||
public string RecoveryCode { get; set; }
|
||||
public string RequestIP { get; set; }
|
||||
public DateTime CreationDate { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
}
|
10
PrivaPub/Models/User/RootToAvatar.cs
Normal file
10
PrivaPub/Models/User/RootToAvatar.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using MongoDB.Entities;
|
||||
|
||||
namespace PrivaPub.Models.User
|
||||
{
|
||||
public class RootToAvatar : Entity
|
||||
{
|
||||
public string RootId { get; set; }
|
||||
public string AvatarId { get; set; }
|
||||
}
|
||||
}
|
48
PrivaPub/Models/User/RootUser.cs
Normal file
48
PrivaPub/Models/User/RootUser.cs
Normal file
@ -0,0 +1,48 @@
|
||||
using MongoDB.Entities;
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PrivaPub.Models.User
|
||||
{
|
||||
public class RootUser : Entity
|
||||
{
|
||||
[StringLength(32)]
|
||||
public string UserName { get; set; }
|
||||
[EmailAddress]
|
||||
public string Email { get; set; }
|
||||
public bool IsEmailValidated { get; set; } = false;
|
||||
public bool IsBanned { get; set; } = false;
|
||||
public string HashedPassword { get; set; }
|
||||
public List<string> Policies { get; set; } = new() { ClientModels.Policies.IsUser };
|
||||
public List<ContactItem> Contacts { get; set; } = new();
|
||||
public RootUserSettings Settings { get; set; } = new();
|
||||
|
||||
public string ResetPasswordToken { get; set; }
|
||||
public DateTime? ResetPasswordTokenSentAt { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? DeletedAt { get; set; }
|
||||
}
|
||||
|
||||
public class ContactItem
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public string Contact { get; set; }
|
||||
public string Note { get; set; }
|
||||
public DateTime CreationDate { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public class RootUserSettings
|
||||
{
|
||||
public string LanguageCode { get; set; } = "en-GB";
|
||||
|
||||
public short IconsThemeIndexColour { get; set; } = 25;
|
||||
public short LightThemeIndexColour { get; set; } = 25;
|
||||
public short DarkThemeIndexColour { get; set; } = 215;
|
||||
public bool PreferSystemTheming { get; set; } = true;
|
||||
public bool ThemeIsDarkMode { get; set; } = false;
|
||||
public bool ThemeIsDarkGray { get; set; } = false;
|
||||
public bool ThemeIsLightGray { get; set; } = true;
|
||||
}
|
||||
}
|
14
PrivaPub/Models/User/RootUserNote.cs
Normal file
14
PrivaPub/Models/User/RootUserNote.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using MongoDB.Entities;
|
||||
|
||||
namespace PrivaPub.Models.User
|
||||
{
|
||||
public class RootUserNote : Entity
|
||||
{
|
||||
public string RootUserId { get; set; }
|
||||
public string AvatarUserId { get; set; }
|
||||
public string Note { get; set; }
|
||||
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
}
|
9
PrivaPub/Models/User/UserPolicyType.cs
Normal file
9
PrivaPub/Models/User/UserPolicyType.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace PrivaPub.Models.User
|
||||
{
|
||||
public enum UserPolicyType
|
||||
{
|
||||
IsUser,
|
||||
IsModerator,
|
||||
IsAdmin
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user