initial commit

This commit is contained in:
2026-07-21 14:08:10 +07:00
commit f7cf118326
533 changed files with 41762 additions and 0 deletions
@@ -0,0 +1,37 @@
using Indotalent.Data.Entities;
using MediatR;
using Microsoft.AspNetCore.Identity;
namespace Indotalent.Features.Profile.Avatar.Cqrs;
public class GetAvatarInfoResponse
{
public string Id { get; set; } = string.Empty;
public string? FullName { get; set; }
public string? AvatarFile { get; set; }
}
public record GetAvatarInfoQuery(string UserId) : IRequest<GetAvatarInfoResponse?>;
public class GetAvatarInfoHandler : IRequestHandler<GetAvatarInfoQuery, GetAvatarInfoResponse?>
{
private readonly UserManager<ApplicationUser> _userManager;
public GetAvatarInfoHandler(UserManager<ApplicationUser> userManager)
{
_userManager = userManager;
}
public async Task<GetAvatarInfoResponse?> Handle(GetAvatarInfoQuery request, CancellationToken cancellationToken)
{
var user = await _userManager.FindByIdAsync(request.UserId);
if (user == null) return null;
return new GetAvatarInfoResponse
{
Id = user.Id,
FullName = user.FullName,
AvatarFile = user.AvatarFile
};
}
}