mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
rework messages
+ addition LocalStorageService + tests
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
namespace Govor.Core.Models;
|
||||
|
||||
public class MediaAttachments
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid MessageId { get; set; }
|
||||
|
||||
public MediaType Type { get; set; }
|
||||
public string FilePath { get; set; } = string.Empty; // путь к файлу (локальный или URL)
|
||||
public string MimeType { get; set; } = string.Empty;
|
||||
|
||||
public string? EncryptedKey { get; set; } // если используется отдельное шифрование
|
||||
public Message Message { get; set; } = null!;
|
||||
}
|
||||
|
||||
public enum MediaType
|
||||
{
|
||||
Image,
|
||||
Video,
|
||||
Audio,
|
||||
File,
|
||||
Voice
|
||||
}
|
||||
@@ -10,6 +10,8 @@ public class Message
|
||||
public DateTime SentAt { get; set; }
|
||||
public bool IsEdited { get; set; } = false;
|
||||
public DateTime? EditedAt { get; set; }
|
||||
public List<MessageReaction> Reactions { get; set; } = new List<MessageReaction>();
|
||||
public List<MediaAttachments> MediaAttachments { get; set; } = new List<MediaAttachments>();
|
||||
}
|
||||
|
||||
public enum RecipientType
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace Govor.Core.Models;
|
||||
|
||||
public class MessageReaction
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid MessageId { get; set; }
|
||||
public Message Message { get; set; }
|
||||
|
||||
public Guid UserId { get; set; }
|
||||
public User User { get; set; }
|
||||
|
||||
public string ReactionCode { get; set; } // "❤️", "🔥", "👍", ":custom_emoji:"
|
||||
public DateTime ReactedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using Govor.Core.Models;
|
||||
|
||||
namespace Govor.Core.Services;
|
||||
|
||||
public interface IAccountService
|
||||
{
|
||||
public Task<string> RegistrationAsync(string name, string password);
|
||||
public Task<string> LoginAsync(string name, string password);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using Govor.Core.Models;
|
||||
|
||||
namespace Govor.Core.Services;
|
||||
|
||||
public interface IGroupService
|
||||
{
|
||||
ChatGroup GetGroupByInvite(string code);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using Govor.Core.Models;
|
||||
|
||||
namespace Govor.Core.Services;
|
||||
|
||||
public interface IJwtService
|
||||
{
|
||||
string GenerateJwtToken(User user);
|
||||
}
|
||||
Reference in New Issue
Block a user