Эндпоинты

This commit is contained in:
Халимов Рустам
2026-03-30 23:41:01 +03:00
parent ce212c11c1
commit d3f1e3f361
50 changed files with 1890 additions and 5 deletions
@@ -0,0 +1,11 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace Knot.Modules.Profiles.Domain;
public interface IAvatarStorageService
{
Task<string> UploadAsync(Stream content, string fileName, string contentType, CancellationToken ct = default);
Task DeleteAsync(string fileId, CancellationToken ct = default);
}
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace Knot.Modules.Profiles.Domain;
public interface IProfileRepository
{
Task<ProfileDocument?> GetByIdAsync(Guid id, CancellationToken ct = default);
Task<ProfileDocument?> GetByUsernameAsync(string username, CancellationToken ct = default);
Task AddAsync(ProfileDocument profile, CancellationToken ct = default);
Task UpdateAsync(ProfileDocument profile, CancellationToken ct = default);
Task<List<ProfileDocument>> SearchAsync(string query, CancellationToken ct = default);
}
@@ -0,0 +1,9 @@
using System.Threading;
using System.Threading.Tasks;
namespace Knot.Modules.Profiles.Domain;
public interface IProfilesUnitOfWork
{
Task SaveChangesAsync(CancellationToken ct = default);
}
@@ -0,0 +1,10 @@
namespace Knot.Modules.Profiles.Domain;
using Knot.Shared.Kernel;
public static class ProfilesErrors
{
public static readonly Error ProfileNotFound = new("Profile.NotFound", "Profile not found");
}
public static class IdentityErrors
{
public static readonly Error UserNotFound = new("Profile.NotFound", "Profile not found");
}