Generator Changes at 9/28/2025 12:46:16 AM
This commit is contained in:
@@ -2,15 +2,21 @@ namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
|
||||
public class GetUserQueryHandler : IRequestHandler<GetUserQuery, GetUserResponseDto>
|
||||
{
|
||||
private readonly IApplicationContractContext _context;
|
||||
private readonly ICurrentUserService _currentUserService;
|
||||
|
||||
public GetUserQueryHandler(IApplicationContractContext context)
|
||||
public GetUserQueryHandler(IApplicationContractContext context, ICurrentUserService currentUserService)
|
||||
{
|
||||
_context = context;
|
||||
_currentUserService = currentUserService;
|
||||
}
|
||||
|
||||
public async Task<GetUserResponseDto> Handle(GetUserQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new GetUserResponseDto();
|
||||
var userId = _currentUserService.UserId ?? throw new ForbiddenAccessException();
|
||||
var response = await _context.User.GetUserAsync(request: new()
|
||||
{
|
||||
Id = long.Parse(userId)
|
||||
}, cancellationToken: cancellationToken);
|
||||
return response.Adapt<GetUserResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user