Миграции, сборка

This commit is contained in:
Халимов Рустам
2026-03-27 23:09:16 +03:00
parent 030ae1e4e4
commit ba5c5210d4
43 changed files with 406 additions and 194 deletions

View File

@@ -1,3 +1,9 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Knot.Modules.Profiles.Domain;
using Knot.Shared.Kernel.Storage;
namespace Knot.Modules.Profiles.Infrastructure.Database;
public class AvatarStorageService : IAvatarStorageService
@@ -11,13 +17,13 @@ public class AvatarStorageService : IAvatarStorageService
public async Task<string> UploadAsync(Stream content, string fileName, string contentType, CancellationToken ct = default)
{
// IFileStorageService не принимает CancellationToken в UploadFileAsync
// IFileStorageService не принимает CancellationToken в UploadFileAsync
return await _fileStorage.UploadFileAsync(content, fileName, contentType);
}
public async Task DeleteAsync(string fileId, CancellationToken ct = default)
{
// IFileStorageService не принимает CancellationToken в DeleteFileAsync
// IFileStorageService не принимает CancellationToken в DeleteFileAsync
await _fileStorage.DeleteFileAsync(fileId);
}
}

View File

@@ -1,3 +1,11 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Knot.Modules.Profiles.Domain;
using MongoDB.Bson;
using MongoDB.Driver;
namespace Knot.Modules.Profiles.Infrastructure.Database;
public class ProfileRepository : IProfileRepository

View File

@@ -1,8 +1,10 @@
using System.Threading;
using System.Threading.Tasks;
using Knot.Modules.Profiles.Domain;
namespace Knot.Modules.Profiles.Infrastructure.Database;
public class ProfilesUnitOfWork : IProfilesUnitOfWork
{
// MongoDB не поддерживает транзакции без репликации в простом виде,
// поэтому UnitOfWork здесь формальный для соответствия интерфейсу.
public Task SaveChangesAsync(CancellationToken ct = default) => Task.CompletedTask;
}