-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
22 changed files
with
125 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
...ontracts/Services/Identity/Identity.proto → ...racts/Services/Identity/identity.v1.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...ervices/Catalog/Catalog.App/Configurations/AuthenticationAuthorizationServiceInstaller.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
global using Grpc.Core; | ||
global using Contracts.Services.Identity; | ||
global using MediatR; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
crs/Services/Identity/Idenitty.Grpc/IdentityGrpcService.cs
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
crs/Services/Identity/Idenitty.Grpc/IdentityGrpcServiceV1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Identity.Application.Users.Queries.GetUserInfoById; | ||
using Identity.V1; | ||
|
||
namespace Idenitty.Grpc; | ||
|
||
public sealed class IdentityGrpcServiceV1(ISender sender) : IdentityService.IdentityServiceBase | ||
{ | ||
private readonly ISender _sender = sender; | ||
|
||
public override async Task<UserInfo> GetUserInfo(GetUserRequest request, ServerCallContext context) | ||
{ | ||
Guid.TryParse(request.Id, out Guid userId); | ||
|
||
//if(userId == Guid.Empty) | ||
//{ | ||
// context.Status = new Status(StatusCode.InvalidArgument, "Invalid user id"); | ||
//} | ||
|
||
var query = new GetUserInfoByIdQuery(userId); | ||
var result = await _sender.Send(query); | ||
var response = new UserInfo() { s}; | ||
return base.GetUser(request, context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
crs/Services/Identity/Identity.Application/Users/Common/UserInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Identity.Application.Users.Common; | ||
|
||
public sealed record UserInfo( | ||
Guid UserId, | ||
string Email, | ||
string FirstName, | ||
string LastName, | ||
bool IsEmailConfirmed, | ||
string Role, | ||
string Gender); |
6 changes: 0 additions & 6 deletions
6
...ces/Identity/Identity.Application/Users/Queries/GetUserInfoById/GetUserInfoByIdHandler.cs
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
...vices/Identity/Identity.Application/Users/Queries/GetUserInfoById/GetUserInfoByIdQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
namespace Identity.Application.Users.Queries.GetUserInfoById; | ||
|
||
public sealed record GetUserInfoByIdQuery(Guid Id) : IQuery<UserInfo>; | ||
|
26 changes: 26 additions & 0 deletions
26
...dentity/Identity.Application/Users/Queries/GetUserInfoById/GetUserInfoByIdQueryHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace Identity.Application.Users.Queries.GetUserInfoById; | ||
|
||
internal sealed class GetUserInfoByIdQueryHandler(IUserRepository userRepository) : IQueryHandler<GetUserInfoByIdQuery, UserInfo> | ||
{ | ||
private readonly IUserRepository _userRepository = userRepository; | ||
|
||
public async Task<Result<UserInfo>> Handle(GetUserInfoByIdQuery request, CancellationToken cancellationToken) | ||
{ | ||
var userId = new UserId(request.Id); | ||
|
||
var user = await _userRepository.GetUserByIdAsync(userId, cancellationToken); | ||
|
||
if (user is null) | ||
{ | ||
return Result.Failure<UserInfo>( | ||
UserErrors.UserDoesNotExist); | ||
} | ||
|
||
var userInfo = new UserInfo( | ||
user.Id, | ||
user.Email.Value, | ||
user.(r => r.Name).ToList()); | ||
|
||
return Result.Success(userInfo); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.