mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
DbGovor init
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
namespace Govor.Core;
|
||||
|
||||
public class Class1
|
||||
{
|
||||
}
|
||||
@@ -6,4 +6,9 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="DTOs\" />
|
||||
<Folder Include="Infrastructure\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace Govor.Core.Models;
|
||||
|
||||
public class ChatGroup
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public List<string> InviteCode { get; set; }
|
||||
public bool IsChannel { get; set; }
|
||||
public bool IsPrivate { get; set; }
|
||||
public List<Guid> Admins { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Govor.Core.Models;
|
||||
|
||||
public class GroupAdmins
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid GroupId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Govor.Core.Models;
|
||||
|
||||
public class GroupMembership
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid GroupId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public bool IsBanned { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace Govor.Core.Models;
|
||||
|
||||
public class User
|
||||
{
|
||||
public Guid Id {get; set;}
|
||||
public string Username {get; set;}
|
||||
public string Description {get; set;}
|
||||
public string HashPassword {get; set;}
|
||||
public Guid IconId {get; set;}
|
||||
public DateTime CreatedOn {get; set;}
|
||||
public DateTime WasOnline {get; set;}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Govor.Core.Models;
|
||||
|
||||
namespace Govor.Core.Repositories;
|
||||
|
||||
public interface IUsersExist
|
||||
{
|
||||
public Task<bool> Exists(User user);
|
||||
public Task<bool> ExistsById(Guid id);
|
||||
public Task<bool> ExistsUsername(string username);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using Govor.Core.Models;
|
||||
|
||||
namespace Govor.Core.Repositories;
|
||||
|
||||
public interface IUsersReader
|
||||
{
|
||||
public Task<IEnumerable<User>> GetAll();
|
||||
public Task<User> FindById(Guid id);
|
||||
public Task<IEnumerable<User>> FindByRangeId(IEnumerable<Guid> ids);
|
||||
public Task<User> FindByUsername(string username);
|
||||
public Task<IEnumerable<User>> FindByRangeUsername(IEnumerable<string> usernames);
|
||||
|
||||
public Task<IEnumerable<User>> FindUsersByCreatedDate(DateOnly createdDate);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Govor.Core.Repositories;
|
||||
|
||||
public interface IUsersRepository : IUsersReader, IUsersWriter, IUsersExist
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using Govor.Core.Models;
|
||||
|
||||
namespace Govor.Core.Repositories;
|
||||
|
||||
public interface IUsersWriter
|
||||
{
|
||||
public Task Add(User user);
|
||||
public Task Update(User user);
|
||||
public Task Remove(User user);
|
||||
public Task Remove(Guid userId);
|
||||
}
|
||||
Reference in New Issue
Block a user