init
This commit is contained in:
commit
f6629fbb33
32 changed files with 1608 additions and 0 deletions
21
Foxchat.Identity/Database/Models/Account.cs
Normal file
21
Foxchat.Identity/Database/Models/Account.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
namespace Foxchat.Identity.Database.Models;
|
||||
|
||||
public class Account
|
||||
{
|
||||
public Ulid Id { get; init; } = Ulid.NewUlid();
|
||||
public string Username { get; set; } = null!;
|
||||
public string Email { get; set; } = null!;
|
||||
public string Password { get; set; } = null!;
|
||||
public AccountRole Role { get; set; }
|
||||
|
||||
public string? Avatar { get; set; }
|
||||
|
||||
public List<Token> Tokens { get; } = [];
|
||||
public List<ChatInstance> ChatInstances { get; } = [];
|
||||
|
||||
public enum AccountRole
|
||||
{
|
||||
User,
|
||||
Admin,
|
||||
}
|
||||
}
|
19
Foxchat.Identity/Database/Models/ChatInstance.cs
Normal file
19
Foxchat.Identity/Database/Models/ChatInstance.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
namespace Foxchat.Identity.Database.Models;
|
||||
|
||||
public class ChatInstance
|
||||
{
|
||||
public Ulid Id { get; init; } = Ulid.NewUlid();
|
||||
public string Domain { get; init; } = null!;
|
||||
public string BaseUrl { get; set; } = null!;
|
||||
public string PublicKey { get; set; } = null!;
|
||||
public InstanceStatus Status { get; set; }
|
||||
public string? Reason { get; set; }
|
||||
|
||||
public List<Account> Accounts { get; } = [];
|
||||
|
||||
public enum InstanceStatus
|
||||
{
|
||||
Active,
|
||||
Suspended,
|
||||
}
|
||||
}
|
10
Foxchat.Identity/Database/Models/GuildAccount.cs
Normal file
10
Foxchat.Identity/Database/Models/GuildAccount.cs
Normal file
|
@ -0,0 +1,10 @@
|
|||
namespace Foxchat.Identity.Database.Models;
|
||||
|
||||
public class GuildAccount
|
||||
{
|
||||
public Ulid ChatInstanceId { get; init; }
|
||||
public ChatInstance ChatInstance { get; init; } = null!;
|
||||
public string GuildId { get; init; } = null!;
|
||||
public Ulid AccountId { get; init; }
|
||||
public Account Account { get; init; } = null!;
|
||||
}
|
8
Foxchat.Identity/Database/Models/Token.cs
Normal file
8
Foxchat.Identity/Database/Models/Token.cs
Normal file
|
@ -0,0 +1,8 @@
|
|||
namespace Foxchat.Identity.Database.Models;
|
||||
|
||||
public class Token
|
||||
{
|
||||
public Ulid Id { get; init; } = Ulid.NewUlid();
|
||||
public Ulid AccountId { get; set; }
|
||||
public Account Account { get; set; } = null!;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue