Импорт
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
using Knot.Shared.Kernel;
|
||||
using Knot.Modules.Conversations.Domain;
|
||||
using Knot.Contracts.Conversations.Domain;
|
||||
using Knot.Modules.Conversations.Infrastructure.SignalR;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Knot.Contracts.Conversations.Domain;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Knot.Modules.Conversations.Domain;
|
||||
|
||||
namespace Knot.Modules.Conversations.Infrastructure.Persistence;
|
||||
|
||||
|
||||
+1
-1
@@ -32,4 +32,4 @@ public class ChatsDbContextFactory : IDesignTimeDbContextFactory<ChatsDbContext>
|
||||
optionsBuilder.UseNpgsql(connectionString);
|
||||
return new ChatsDbContext(optionsBuilder.Options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-4
@@ -4,19 +4,18 @@ using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Knot.Contracts.Conversations.Application.Abstractions;
|
||||
using Knot.Contracts.Conversations.Domain;
|
||||
using Knot.Contracts.Conversations.Infrastructure.Persistence;
|
||||
using Knot.Modules.Conversations.Application.Abstractions;
|
||||
using Knot.Modules.Conversations.Domain;
|
||||
using Knot.Shared.Kernel;
|
||||
using Knot.Shared.Kernel.Security;
|
||||
using MediatR;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using DomainChat = Knot.Modules.Conversations.Domain.Chat;
|
||||
using DomainChat = Knot.Contracts.Conversations.Domain.Chat;
|
||||
|
||||
namespace Knot.Modules.Conversations.Infrastructure.Persistence;
|
||||
|
||||
public sealed class ChatsDbContext : DbContext, Knot.Modules.Conversations.Application.Abstractions.IChatsUnitOfWork, Knot.Contracts.Conversations.Infrastructure.Persistence.IChatsDbContext
|
||||
public sealed class ChatsDbContext : DbContext, Knot.Contracts.Conversations.Application.Abstractions.IChatsUnitOfWork, Knot.Contracts.Conversations.Infrastructure.Persistence.IChatsDbContext
|
||||
{
|
||||
private readonly IMediator? _mediator;
|
||||
private readonly IEncryptionService? _encryptionService;
|
||||
@@ -54,6 +53,8 @@ public sealed class ChatsDbContext : DbContext, Knot.Modules.Conversations.Appli
|
||||
{
|
||||
builder.ToTable("Chats");
|
||||
builder.HasKey(c => c.Id);
|
||||
builder.Property(c => c.IsImporting);
|
||||
builder.Property(c => c.ImportJobId);
|
||||
builder.Property(c => c.Type).HasConversion<string>();
|
||||
|
||||
builder.OwnsMany(c => c.Members, mb =>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
using Knot.Modules.Conversations.Domain;
|
||||
using Knot.Contracts.Conversations.Domain;
|
||||
using MongoDB.Bson.Serialization;
|
||||
|
||||
namespace Knot.Modules.Conversations.Infrastructure.Persistence.Mongo;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
using Knot.Modules.Conversations.Domain;
|
||||
using Knot.Contracts.Conversations.Domain;
|
||||
using MongoDB.Driver;
|
||||
|
||||
namespace Knot.Modules.Conversations.Infrastructure.Persistence.Mongo;
|
||||
|
||||
@@ -18,4 +18,4 @@ public sealed class UserDeleterService : IUserDeleterService
|
||||
{
|
||||
return await _sender.Send(new DeleteUserCommand(userId), cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using Knot.Modules.Conversations.Application.Abstractions;
|
||||
using Knot.Contracts.Conversations.Application.Abstractions;
|
||||
using Knot.Modules.Conversations.Infrastructure.SignalR;
|
||||
|
||||
namespace Knot.Modules.Conversations.Infrastructure.Services;
|
||||
|
||||
public sealed class UserStatusService : IUserStatusService, Knot.Contracts.Conversations.Abstractions.IUserStatusService
|
||||
public sealed class UserStatusService :
|
||||
Knot.Contracts.Conversations.Application.Abstractions.IUserStatusService,
|
||||
Knot.Contracts.Conversations.Abstractions.IUserStatusService
|
||||
{
|
||||
public bool IsUserOnline(string userId)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ using Knot.Modules.Conversations.Application.Messages.Send;
|
||||
using Knot.Modules.Conversations.Application.Messages.Read;
|
||||
using Knot.Modules.Conversations.Application.Messages.Delete;
|
||||
using Knot.Modules.Conversations.Application.Messages.React;
|
||||
using Knot.Modules.Conversations.Domain;
|
||||
using Knot.Contracts.Conversations.Domain;
|
||||
using Knot.Shared.Kernel;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Knot.Contracts.Auth.Domain;
|
||||
|
||||
@@ -5,4 +5,4 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Knot.Contracts.Messaging.Application.Abstractions;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
public class MessageNotifier : IMessageNotifier { private readonly IHubContext<ChatHub> _hubContext; public MessageNotifier(IHubContext<ChatHub> hubContext) { _hubContext = hubContext; } public Task NotifyNewMessageAsync(Guid chatId, object messagePayload, CancellationToken cancellationToken) { return _hubContext.Clients.Group(chatId.ToString()).SendAsync("new_message", messagePayload, cancellationToken); } }
|
||||
public class MessageNotifier : IMessageNotifier { private readonly IHubContext<ChatHub> _hubContext; public MessageNotifier(IHubContext<ChatHub> hubContext) { _hubContext = hubContext; } public Task NotifyNewMessageAsync(Guid chatId, object messagePayload, CancellationToken cancellationToken) { return _hubContext.Clients.Group(chatId.ToString()).SendAsync("new_message", messagePayload, cancellationToken); } }
|
||||
|
||||
Reference in New Issue
Block a user