Вытащил солюшен на уровень выше, чтобы прощё было дотнетить
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
namespace ApplicationLayer.InfrastructureServicesInterfaces;
|
||||
|
||||
public interface IDateTimeProvider
|
||||
{
|
||||
/// Returns current date and time
|
||||
DateTime Now();
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using Domains;
|
||||
|
||||
namespace ApplicationLayer.InfrastructureServicesInterfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Generic repository pattern
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Entity type</typeparam>
|
||||
public interface IGenericRepository<T> where T : class, IEntity
|
||||
{
|
||||
/// Get all entities from data storage
|
||||
/// <param name="cancellationToken">Cancellation token</param>
|
||||
Task<List<T>> GetAllAsync(CancellationToken cancellationToken);
|
||||
|
||||
/// Get one entity with specific id
|
||||
/// <param name="id">Identifier of entity</param>
|
||||
/// <param name="cancellationToken">Cancellation token</param>
|
||||
Task<T> GetByIdAsync(Guid id, CancellationToken cancellationToken);
|
||||
|
||||
/// Add entity to storage
|
||||
/// <param name="entity">Entity to add</param>
|
||||
/// <param name="cancellationToken">Cancellation token</param>
|
||||
Task AddAsync(T entity, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Update entity in storage
|
||||
/// </summary>
|
||||
/// <param name="entity">Entity to update</param>
|
||||
/// <param name="cancellationToken">Cancellation token</param>
|
||||
Task UpdateAsync(T entity, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Remove entity from storage
|
||||
/// </summary>
|
||||
/// <param name="entity">Entity to remove</param>
|
||||
void Remove(T entity);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using ApplicationLayer.Services.AuthServices.Common;
|
||||
using Domains.Users;
|
||||
|
||||
namespace ApplicationLayer.InfrastructureServicesInterfaces;
|
||||
|
||||
/// Generates jwt-tokens
|
||||
public interface ITokenGenerator
|
||||
{
|
||||
/// returns jwt-token for specific user
|
||||
AuthToken CreateToken(User user);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace ApplicationLayer.InfrastructureServicesInterfaces;
|
||||
|
||||
public interface IUnitOfWork
|
||||
{
|
||||
/// Saves changes in data storage
|
||||
/// <param name="cancellationToken">Cancellation Token</param>
|
||||
Task SaveAsync(CancellationToken cancellationToken);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace ApplicationLayer.InfrastructureServicesInterfaces;
|
||||
|
||||
public interface IUserIdProvider
|
||||
{
|
||||
/// Returns identifier of authenticated user who sent the request
|
||||
Guid GetUserId();
|
||||
}
|
||||
Reference in New Issue
Block a user