fix: align backend APIs and upload flow
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using GroupService.Domain.Enums;
|
||||
using GroupService.Domain.Enums;
|
||||
using GroupService.Domain.Events;
|
||||
using IM.DomainCommons;
|
||||
|
||||
@@ -65,13 +65,15 @@ namespace GroupService.Domain.Entities
|
||||
AddDomainEvent(new AllMembersBannedDomainEvent(this));
|
||||
}
|
||||
|
||||
public void Ban()
|
||||
public void Ban(bool notify = true)
|
||||
{
|
||||
Status = GroupState.Blocked;
|
||||
ModificationTime = DateTime.Now;
|
||||
AddDomainEvent(new GroupBlockedDomainEvent(this));
|
||||
if (notify) AddDomainEvent(new GroupBlockedDomainEvent(this));
|
||||
}
|
||||
|
||||
public void Unban() { Status = GroupState.Normal; ModificationTime = DateTime.Now; }
|
||||
|
||||
public void Update(string? name, GroupAuthorityType? groupAuthority, string? announcement, string? avatar)
|
||||
{
|
||||
bool isChanged = false;
|
||||
|
||||
@@ -49,5 +49,12 @@ namespace GroupService.Domain.Entities
|
||||
{
|
||||
GroupNickName = nickname;
|
||||
}
|
||||
|
||||
public void Leave()
|
||||
{
|
||||
if (IsDeleted) return;
|
||||
SoftDelete();
|
||||
AddDomainEvent(new GroupMemberLeftDomainEvent(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user