fix: align backend APIs and upload flow
This commit is contained in:
@@ -57,24 +57,22 @@ namespace MessageService.Domain.Entities
|
||||
AddDomainEvent(new ConversationCreatedDomainEvent(this));
|
||||
}
|
||||
|
||||
public void Update(long? LastReadSequenceId = default, int? unreadCount = default, string? lastMsg = default)
|
||||
public void SetLastReadSequence(long sequenceId)
|
||||
{
|
||||
if (LastReadSequenceId != null)
|
||||
{
|
||||
LastReadSequenceId = LastReadSequenceId.Value;
|
||||
this.NotifyModified();
|
||||
}
|
||||
if (unreadCount != null)
|
||||
{
|
||||
UnreadCount += unreadCount.Value;
|
||||
NotifyModified();
|
||||
}
|
||||
LastReadSequenceId = sequenceId;
|
||||
NotifyModified();
|
||||
}
|
||||
|
||||
if (lastMsg != null)
|
||||
{
|
||||
LastMessage = lastMsg;
|
||||
NotifyModified();
|
||||
}
|
||||
public void IncrementUnread()
|
||||
{
|
||||
UnreadCount += 1;
|
||||
NotifyModified();
|
||||
}
|
||||
|
||||
public void UpdateLastMessage(string lastMessage)
|
||||
{
|
||||
LastMessage = lastMessage;
|
||||
NotifyModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +84,7 @@ namespace MessageService.Domain.Entities
|
||||
UnreadCount = 0;
|
||||
if (lastReadSequenceId.HasValue)
|
||||
LastReadSequenceId = lastReadSequenceId.Value;
|
||||
NotifyModified();
|
||||
}
|
||||
|
||||
public void UpdateProfile(string name, string avatar)
|
||||
|
||||
Reference in New Issue
Block a user