Generator Changes at 9/28/2025 12:46:16 AM

This commit is contained in:
MeysamMoghaddam
2025-09-28 00:55:35 +03:30
parent c8924255ac
commit b1161e4320
6 changed files with 424 additions and 574 deletions

View File

@@ -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>();
}
}