Enhance inbound management by removing MaxClients property
- Removed the MaxClients property from Inbound-related data models, including InboundDto and PublishInboundCommand. - Updated related methods and handlers to reflect the removal of MaxClients, ensuring consistent behavior across the application. - Adjusted API documentation and frontend components to remove references to MaxClients, streamlining the inbound publishing process. - Enhanced logging in command handlers to handle node unavailability scenarios during user actions. - Improved database schema and migrations to align with the updated data model.
This commit is contained in:
+4
-5
@@ -22,14 +22,13 @@ public class PublishInboundCommandHandlerTests
|
||||
var roleId = Guid.NewGuid();
|
||||
var handler = new PublishInboundCommandHandler(dbContext, _currentUser);
|
||||
|
||||
var command = new PublishInboundCommand(inbound.Id, true, "EU Fast", [roleId], 100);
|
||||
var command = new PublishInboundCommand(inbound.Id, true, "EU Fast", [roleId]);
|
||||
|
||||
var result = await handler.Handle(command, CancellationToken.None);
|
||||
|
||||
Assert.True(result.IsSuccess);
|
||||
Assert.True(inbound.IsPublished);
|
||||
Assert.Equal("EU Fast", inbound.DisplayName);
|
||||
Assert.Equal(100, inbound.MaxClients);
|
||||
Assert.Contains(roleId, inbound.AllowedRoleIds);
|
||||
Assert.Equal("EU Fast", result.Value.DisplayName);
|
||||
}
|
||||
@@ -39,13 +38,13 @@ public class PublishInboundCommandHandlerTests
|
||||
{
|
||||
using var dbContext = InMemoryDbContextFactory.Create();
|
||||
var inbound = Inbound.FromRemote(Guid.NewGuid(), "1", VpnProtocol.Vless, "remark", 443);
|
||||
inbound.Publish("EU Fast", [Guid.NewGuid()], 100);
|
||||
inbound.Publish("EU Fast", [Guid.NewGuid()]);
|
||||
dbContext.Inbounds.Add(inbound);
|
||||
await dbContext.SaveChangesAsync(CancellationToken.None);
|
||||
|
||||
var handler = new PublishInboundCommandHandler(dbContext, _currentUser);
|
||||
|
||||
var command = new PublishInboundCommand(inbound.Id, false, null, [], null);
|
||||
var command = new PublishInboundCommand(inbound.Id, false, null, []);
|
||||
|
||||
var result = await handler.Handle(command, CancellationToken.None);
|
||||
|
||||
@@ -60,7 +59,7 @@ public class PublishInboundCommandHandlerTests
|
||||
|
||||
var handler = new PublishInboundCommandHandler(dbContext, _currentUser);
|
||||
|
||||
var command = new PublishInboundCommand(Guid.NewGuid(), true, "EU Fast", [], null);
|
||||
var command = new PublishInboundCommand(Guid.NewGuid(), true, "EU Fast", []);
|
||||
|
||||
var result = await handler.Handle(command, CancellationToken.None);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user