mirror of https://github.com/abpframework/abp.git
8 changed files with 81 additions and 6 deletions
@ -0,0 +1,11 @@ |
|||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Application.Services; |
||||
|
|
||||
|
namespace Volo.Abp.Identity.Integration; |
||||
|
|
||||
|
[IntegrationService] |
||||
|
public interface IIdentityUserIntegrationService : IApplicationService |
||||
|
{ |
||||
|
Task<string[]> GetRoleNamesAsync(Guid id); |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Volo.Abp.Identity.Integration; |
||||
|
|
||||
|
public class IdentityUserIntegrationService : IdentityAppServiceBase, IIdentityUserIntegrationService |
||||
|
{ |
||||
|
protected IIdentityUserRepository UserRepository { get; } |
||||
|
|
||||
|
public IdentityUserIntegrationService(IIdentityUserRepository userRepository) |
||||
|
{ |
||||
|
UserRepository = userRepository; |
||||
|
} |
||||
|
|
||||
|
public async Task<string[]> GetRoleNamesAsync(Guid id) |
||||
|
{ |
||||
|
return (await UserRepository.GetRoleNamesAsync(id)).ToArray(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp.AspNetCore.Mvc; |
||||
|
|
||||
|
namespace Volo.Abp.Identity.Integration; |
||||
|
|
||||
|
[RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)] |
||||
|
[Area(IdentityRemoteServiceConsts.ModuleName)] |
||||
|
[ControllerName("UserIntegration")] |
||||
|
[Route("integration-api/identity/users")] |
||||
|
public class IdentityUserIntegrationController : AbpControllerBase, IIdentityUserIntegrationService |
||||
|
{ |
||||
|
protected IIdentityUserIntegrationService UserIntegrationService { get; } |
||||
|
|
||||
|
public IdentityUserIntegrationController(IIdentityUserIntegrationService userIntegrationService) |
||||
|
{ |
||||
|
UserIntegrationService = userIntegrationService; |
||||
|
} |
||||
|
|
||||
|
[HttpGet] |
||||
|
[Route("{id}/role-names")] |
||||
|
public virtual Task<string[]> GetRoleNamesAsync(Guid id) |
||||
|
{ |
||||
|
return UserIntegrationService.GetRoleNamesAsync(id); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue