Эндпоинты
This commit is contained in:
@@ -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");
|
||||
}
|
||||
Reference in New Issue
Block a user