Сборка бэк

This commit is contained in:
Халимов Рустам
2026-03-27 15:45:34 +03:00
parent 16978c423c
commit 11f2b232a3
135 changed files with 2162 additions and 725 deletions

View File

@@ -14,7 +14,7 @@ using Knot.Modules.Conversations.Domain;
using MongoDB.Driver;
using Microsoft.EntityFrameworkCore;
namespace Host.Application.Admin.Commands;
namespace Knot.Modules.Admin.Application.Admin.Commands;
public record CleanRunCommand(IFileStorageService FileStorage, AuthDbContext IdentityDb) : ICommand<MessageResponse>;
@@ -99,4 +99,4 @@ internal sealed class CleanRunCommandHandler : ICommandHandler<CleanRunCommand,
return Result.Success(new MessageResponse("Cleanup completed successfully"));
}
}
}

View File

@@ -12,7 +12,7 @@ using Knot.Modules.Auth.Domain;
using Knot.Modules.Auth.Infrastructure.Persistence;
using Knot.Modules.Auth.Application.Abstractions;
namespace Host.Application.Admin.Commands;
namespace Knot.Modules.Admin.Application.Admin.Commands;
public record ResetUserPasswordCommand(Guid UserId, string NewPassword) : ICommand<SuccessResponse>;
@@ -44,4 +44,4 @@ internal sealed class ResetUserPasswordCommandHandler : ICommandHandler<ResetUse
await _identityUnitOfWork.SaveChangesAsync(cancellationToken);
return Result.Success(new SuccessResponse(true));
}
}
}

View File

@@ -2,10 +2,11 @@ using System.Threading;
using System.Threading.Tasks;
using MediatR;
using Knot.Shared.Kernel;
using Knot.Shared.Kernel.Configuration;
using Knot.Modules.Settings.Application.Settings.Abstractions;
using Knot.Modules.Settings.Application.Settings.DTOs;
using Knot.Modules.Stories.Application.Abstractions;
namespace Host.Application.Admin.Commands.TestKlipy;
namespace Knot.Modules.Admin.Application.Admin.Commands.TestKlipy;
public record TestKlipyConnectionCommand() : ICommand<bool>;
@@ -37,3 +38,5 @@ internal sealed class TestKlipyConnectionCommandHandler : ICommandHandler<TestKl
return Result.Success(true);
}
}

View File

@@ -4,10 +4,11 @@ using System.Threading;
using System.Threading.Tasks;
using MediatR;
using Knot.Shared.Kernel;
using Knot.Shared.Kernel.Configuration;
using Knot.Modules.Settings.Application.Settings.Abstractions;
using Knot.Modules.Settings.Application.Settings.DTOs;
using System.Security.Cryptography;
namespace Host.Application.Admin.Commands;
namespace Knot.Modules.Admin.Application.Admin.Commands;
public record UpdateSettingsCommand(SystemSettingsDto Settings) : ICommand<SystemSettingsDto>;
@@ -43,4 +44,6 @@ internal sealed class UpdateSettingsCommandHandler : ICommandHandler<UpdateSetti
return Result.Success(request.Settings);
}
}
}

View File

@@ -17,7 +17,7 @@ using Knot.Modules.Auth.Application.Auth.DTOs;
using Knot.Modules.Auth.Application.Users;
namespace Host.Application.Admin.Queries;
namespace Knot.Modules.Admin.Application.Admin.Queries;
public record CleanDryRunQuery(IFileStorageService FileStorage, AuthDbContext IdentityDb) : IQuery<CleanupDryRunResultDto>;
@@ -102,4 +102,4 @@ internal sealed class CleanDryRunQueryHandler : IQueryHandler<CleanDryRunQuery,
OrphanedMediaBytes = safeBytes
});
}
}
}

View File

@@ -5,7 +5,7 @@ using MediatR;
using Knot.Shared.Kernel;
using Knot.Shared.Kernel.Services;
namespace Host.Application.Admin.Queries;
namespace Knot.Modules.Admin.Application.Admin.Queries;
public record GetDashboardStatsQuery() : IQuery<DashboardStatsDto>;
@@ -23,4 +23,4 @@ internal sealed class GetDashboardStatsQueryHandler : IQueryHandler<GetDashboard
var stats = await _statisticsService.GetDashboardStatsAsync(cancellationToken);
return Result.Success(stats);
}
}
}

View File

@@ -4,9 +4,10 @@ using System.Threading;
using System.Threading.Tasks;
using MediatR;
using Knot.Shared.Kernel;
using Knot.Shared.Kernel.Configuration;
using Knot.Modules.Settings.Application.Settings.Abstractions;
using Knot.Modules.Settings.Application.Settings.DTOs;
namespace Host.Application.Admin.Queries;
namespace Knot.Modules.Admin.Application.Admin.Queries;
public record GetSettingsQuery() : IQuery<SystemSettingsDto>;
@@ -24,4 +25,5 @@ internal sealed class GetSettingsQueryHandler : IQueryHandler<GetSettingsQuery,
var settings = await _settingsService.GetSettingsAsync(cancellationToken);
return Result.Success(settings);
}
}
}

View File

@@ -14,7 +14,7 @@ using Knot.Modules.Auth.Domain;
using Knot.Modules.Conversations.Domain;
using MongoDB.Driver;
namespace Host.Application.Admin.Queries;
namespace Knot.Modules.Admin.Application.Admin.Queries;
public record GetUserDetailsQuery(Guid UserId) : IQuery<AdminUserDetailsDto>;
@@ -74,4 +74,4 @@ internal sealed class GetUserDetailsQueryHandler : IQueryHandler<GetUserDetailsQ
return Result.Success(result);
}
}
}

View File

@@ -11,7 +11,7 @@ using Knot.Modules.Auth.Application.Auth.DTOs;
using Knot.Modules.Auth.Application.Users;
using Knot.Modules.Auth.Domain;
namespace Host.Application.Admin.Queries;
namespace Knot.Modules.Admin.Application.Admin.Queries;
public record SearchUsersQuery(string Query) : IQuery<List<AdminUserDto>>;
@@ -43,4 +43,4 @@ internal sealed class SearchUsersQueryHandler : IQueryHandler<SearchUsersQuery,
return Result.Success(result);
}
}
}

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using Knot.Shared.Kernel;
using Knot.Shared.Kernel.Configuration;
using Knot.Modules.Settings.Application.Settings.Abstractions;
using Knot.Modules.Settings.Application.Settings.DTOs;
namespace Knot.Modules.Admin.Domain.Events;
@@ -8,3 +9,4 @@ namespace Knot.Modules.Admin.Domain.Events;
/// Доменное событие: глобальные настройки системы обновлены.
/// </summary>
public sealed record SystemSettingsUpdatedDomainEvent(SystemSettingsDto Settings) : IDomainEvent;

View File

@@ -18,5 +18,7 @@
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>Knot.Modules.Admin.UnitTests</_Parameter1>
</AssemblyAttribute>
<ProjectReference Include="..\Settings\Knot.Modules.Settings.csproj" />
</ItemGroup>
</Project>
</Project>

View File

@@ -1,18 +1,19 @@
using Carter;
using Knot.Modules.Auth.Application.Auth.DTOs;
using Knot.Shared.Kernel;
using Knot.Shared.Kernel.Configuration;
using Knot.Modules.Settings.Application.Settings.Abstractions;
using Knot.Modules.Settings.Application.Settings.DTOs;
using Knot.Modules.Auth.Application.Users.Register;
using Knot.Shared.Kernel.Storage;
using Knot.Modules.Auth.Infrastructure.Persistence;
using MediatR;
using Host.Application.Admin.Queries;
using Host.Application.Admin.Commands;
using Knot.Modules.Admin.Application.Admin.Queries;
using Knot.Modules.Admin.Application.Admin.Commands;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Mvc;
using Host.Application.Admin.Commands.TestKlipy;
using Knot.Modules.Admin.Application.Admin.Commands.TestKlipy;
namespace Knot.Host.Presentation.Endpoints;
@@ -90,4 +91,5 @@ public sealed class AdminEndpoints : ICarterModule
return Results.Ok(result.Value);
});
}
}
}