添加项目文件。

This commit is contained in:
2026-05-09 17:06:30 +08:00
parent c60f5fe117
commit 720ef957d4
378 changed files with 14843 additions and 0 deletions
@@ -0,0 +1,46 @@
using GroupService.WebApi.Application.Dtos;
using Grpc.Core;
using IM.Commons;
using IM.Protocols.Grpc.User;
namespace GroupService.WebApi.Application.IntegrationServices
{
public class IDentityIntegrationService : IIdentityIntegrationService
{
private readonly UserInternal.UserInternalClient client;
public IDentityIntegrationService(UserInternal.UserInternalClient client)
{
this.client = client;
}
public async Task<Result<UserInfoDto>> FindUserByIdAsync(Guid id)
{
try
{
var response = await client.GetUserInfoAsyncAsync(new GetUserInfoRequest()
{
UserId = id.ToString()
});
return Result.Success(new UserInfoDto()
{
Avatar = response.Avatar,
CreationTime = response.CreationTime.ToDateTimeOffset(),
Deletion = response.Deletion.ToDateTimeOffset(),
Description = response.Description,
Email = response.Email,
Id = Guid.Parse(response.Id),
NickName = response.NickName,
Phone = response.Phone,
Region = response.Region,
UserName = response.UserName
});
}catch(RpcException e)
{
return Result.Fail<UserInfoDto>(ResultCode.USER_NOT_FOUND);
}
}
}
}