style: 修改聚合跟类命名
This commit is contained in:
@@ -12,11 +12,11 @@ using Yi.Framework.ChatHub.Domain.Shared.Model;
|
||||
namespace Yi.Framework.ChatHub.Domain.Entities
|
||||
{
|
||||
[SugarTable("YiMessage")]
|
||||
[SugarIndex($"index_{nameof(MessageEntity)}",
|
||||
[SugarIndex($"index_{nameof(MessageAggregateRoot)}",
|
||||
nameof(ReceiveId), OrderByType.Asc,
|
||||
nameof(SendUserId), OrderByType.Asc,
|
||||
nameof(CreationTime), OrderByType.Asc)]
|
||||
public class MessageEntity : Entity<Guid>, IHasCreationTime
|
||||
public class MessageAggregateRoot : AggregateRoot<Guid>, IHasCreationTime
|
||||
{
|
||||
public static MessageContext CreatePersonal(string content, Guid userId, Guid sendUserId)
|
||||
{
|
||||
@@ -19,8 +19,8 @@ namespace Yi.Framework.ChatHub.Domain.Managers
|
||||
public class UserMessageManager : DomainService
|
||||
{
|
||||
private IHubContext<ChatCenterHub> _hubContext;
|
||||
public ISqlSugarRepository<MessageEntity> _repository;
|
||||
public UserMessageManager(IHubContext<ChatCenterHub> hubContext, ISqlSugarRepository<MessageEntity> repository)
|
||||
public ISqlSugarRepository<MessageAggregateRoot> _repository;
|
||||
public UserMessageManager(IHubContext<ChatCenterHub> hubContext, ISqlSugarRepository<MessageAggregateRoot> repository)
|
||||
{
|
||||
_hubContext = hubContext;
|
||||
_repository = repository;
|
||||
@@ -57,7 +57,7 @@ namespace Yi.Framework.ChatHub.Domain.Managers
|
||||
|
||||
public async Task CreateMessageStoreAsync(MessageContext context)
|
||||
{
|
||||
await _repository.InsertAsync(context.Adapt<MessageEntity>());
|
||||
await _repository.InsertAsync(context.Adapt<MessageAggregateRoot>());
|
||||
}
|
||||
|
||||
public async Task<List<ChatOnlineUserCacheItem>> GetAllUserAsync()
|
||||
|
||||
Reference in New Issue
Block a user