Temporary solution for UserContext (callerId)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
using AipsCore.Domain.Models.User.ValueObjects;
|
||||
|
||||
namespace AipsCore.Application.Abstract.UserContext;
|
||||
|
||||
public interface IUserContext
|
||||
{
|
||||
UserId GetCurrentUserId();
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
using AipsCore.Application.Abstract;
|
||||
using AipsCore.Application.Abstract.Command;
|
||||
using AipsCore.Application.Common.Dispatcher;
|
||||
using AipsCore.Application.Models.User.Command.CreateUser;
|
||||
using AipsCore.Domain.Models.User.ValueObjects;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
@@ -16,6 +13,8 @@ public static class AipsRegistrationExtensions
|
||||
services.AddTransient<IDispatcher, Dispatcher>();
|
||||
|
||||
services.AddPersistence(configuration);
|
||||
|
||||
services.AddUserContext();
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using AipsCore.Application.Abstract.UserContext;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace AipsCore.Infrastructure.DI;
|
||||
|
||||
public static class UserContextRegistrationExtension
|
||||
{
|
||||
public static IServiceCollection AddUserContext(this IServiceCollection services)
|
||||
{
|
||||
services.AddTransient<IUserContext, UserContext>();
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
14
dotnet/AipsCore/Infrastructure/UserContext.cs
Normal file
14
dotnet/AipsCore/Infrastructure/UserContext.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using AipsCore.Application.Abstract.UserContext;
|
||||
using AipsCore.Domain.Models.User.ValueObjects;
|
||||
|
||||
namespace AipsCore.Infrastructure;
|
||||
|
||||
public class UserContext : IUserContext
|
||||
{
|
||||
public UserId GetCurrentUserId()
|
||||
{
|
||||
return new UserId(new Guid("156b58b0-d0f1-4498-b2b6-afa536b68b1a").ToString());
|
||||
}
|
||||
}
|
||||
|
||||
//Ovo je samo trenutno resenje
|
||||
Reference in New Issue
Block a user