Browse Source

Implemented new module structure for Identity module.

pull/221/head
Halil İbrahim Kalkan 9 years ago
parent
commit
11b74bd75d
  1. 1
      src/MicroserviceDemo/MicroserviceDemo.Web/MicroserviceDemo.Web.csproj
  2. 2
      src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs
  3. 6
      src/Volo.Abp.Identity.HttpApi.Host/AbpIdentityHttpApiHostModule.cs
  4. 1
      src/Volo.Abp.Identity.HttpApi.Host/Volo.Abp.Identity.HttpApi.Host.csproj
  5. 2
      src/Volo.Abp.Identity.HttpApi/Volo.Abp.Identity.HttpApi.csproj
  6. 17
      src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/AbpIdentityHttpApiModule.cs
  7. 65
      src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs
  8. 69
      src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserController.cs
  9. 2
      src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs
  10. 2
      src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj
  11. 10
      src/Volo.Abp.MultiTenancy.HttpApi/Volo/Abp/MultiTenancy/TenantController.cs

1
src/MicroserviceDemo/MicroserviceDemo.Web/MicroserviceDemo.Web.csproj

@ -28,6 +28,7 @@
<ItemGroup>
<ProjectReference Include="..\..\Volo.Abp.AspNetCore.Authentication.OAuth\Volo.Abp.AspNetCore.Authentication.OAuth.csproj" />
<ProjectReference Include="..\..\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
<ProjectReference Include="..\..\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj" />
<ProjectReference Include="..\..\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" />

2
src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs

@ -28,7 +28,7 @@ namespace MicroserviceDemo.Web
{
[DependsOn(typeof(AbpAutofacModule))]
[DependsOn(typeof(AbpPermissionsEntityFrameworkCoreModule))]
[DependsOn(typeof(AbpIdentityHttpApiModule))]
[DependsOn(typeof(AbpIdentityApplicationModule))]
[DependsOn(typeof(AbpIdentityWebModule))]
[DependsOn(typeof(AbpIdentityEntityFrameworkCoreModule))]
[DependsOn(typeof(AbpMultiTenancyHttpApiClientModule))]

6
src/Volo.Abp.Identity.HttpApi.Host/AbpIdentityHttpApiHostModule.cs

@ -18,7 +18,11 @@ using Volo.Abp.Modularity;
namespace Volo.Abp.Identity.HttpApi.Host
{
[DependsOn(typeof(AbpIdentityHttpApiModule), typeof(AbpIdentityEntityFrameworkCoreModule), typeof(AbpAutofacModule))]
[DependsOn(
typeof(AbpIdentityApplicationModule),
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpIdentityHttpApiModule),
typeof(AbpAutofacModule))]
public class AbpIdentityHttpApiHostModule : AbpModule
{
public override void PreConfigureServices(IServiceCollection services)

1
src/Volo.Abp.Identity.HttpApi.Host/Volo.Abp.Identity.HttpApi.Host.csproj

@ -19,6 +19,7 @@
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
<ProjectReference Include="..\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj" />
</ItemGroup>

2
src/Volo.Abp.Identity.HttpApi/Volo.Abp.Identity.HttpApi.csproj

@ -19,7 +19,7 @@
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" />
<ProjectReference Include="..\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
<ProjectReference Include="..\Volo.Abp.Identity.Application.Contracts\Volo.Abp.Identity.Application.Contracts.csproj" />
</ItemGroup>
</Project>

17
src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/AbpIdentityHttpApiModule.cs

@ -1,28 +1,15 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Modularity;
namespace Volo.Abp.Identity
{
[DependsOn(typeof(AbpIdentityApplicationModule), typeof(AbpAspNetCoreMvcModule))]
[DependsOn(typeof(AbpIdentityApplicationContractsModule), typeof(AbpAspNetCoreMvcModule))]
public class AbpIdentityHttpApiModule : AbpModule
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddAssemblyOf<AbpIdentityHttpApiModule>();
services.Configure<AbpAspNetCoreMvcOptions>(options =>
{
options.ConventionalControllers.Create(
typeof(AbpIdentityApplicationModule).Assembly,
opts =>
{
opts.RootPath = "identity";
opts.UrlControllerNameNormalizer = context => context.ControllerName.RemovePreFix("Identity");
}
);
});
}
}
}

65
src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs

@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Permissions;
namespace Volo.Abp.Identity
{
[RemoteService]
[Area("identity")]
[Controller]
[ControllerName("Role")]
public class IdentityRoleController : IIdentityRoleAppService, ITransientDependency
{
private readonly IIdentityRoleAppService _roleAppService;
public IdentityRoleController(IIdentityRoleAppService roleAppService)
{
_roleAppService = roleAppService;
}
public virtual Task<IdentityRoleDto> GetAsync(Guid id)
{
return _roleAppService.GetAsync(id);
}
public virtual Task<PagedResultDto<IdentityRoleDto>> GetListAsync(GetIdentityRolesInput input)
{
return _roleAppService.GetListAsync(input);
}
public virtual Task<IdentityRoleDto> CreateAsync(IdentityRoleCreateDto input)
{
return _roleAppService.CreateAsync(input);
}
public virtual Task<IdentityRoleDto> UpdateAsync(Guid id, IdentityRoleUpdateDto input)
{
return _roleAppService.UpdateAsync(id, input);
}
public virtual Task DeleteAsync(Guid id)
{
return _roleAppService.DeleteAsync(id);
}
public virtual Task<List<IdentityRoleDto>> GetAllListAsync()
{
return _roleAppService.GetAllListAsync();
}
public virtual Task<GetPermissionListResultDto> GetPermissionsAsync(Guid id)
{
return _roleAppService.GetPermissionsAsync(id);
}
public virtual Task UpdatePermissionsAsync(Guid id, UpdatePermissionsDto input)
{
return _roleAppService.UpdatePermissionsAsync(id, input);
}
}
}

69
src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserController.cs

@ -0,0 +1,69 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Permissions;
namespace Volo.Abp.Identity
{
[RemoteService]
[Area("identity")]
[Controller]
[ControllerName("User")]
public class IdentityUserController : IIdentityUserAppService, ITransientDependency //TODO: Try to implement these type wrapper controllers automatically!
{
private readonly IIdentityUserAppService _userAppService;
public IdentityUserController(IIdentityUserAppService userAppService)
{
_userAppService = userAppService;
}
public virtual Task<IdentityUserDto> GetAsync(Guid id)
{
return _userAppService.GetAsync(id);
}
public virtual Task<PagedResultDto<IdentityUserDto>> GetListAsync(GetIdentityUsersInput input)
{
return _userAppService.GetListAsync(input);
}
public virtual Task<IdentityUserDto> CreateAsync(IdentityUserCreateDto input)
{
return _userAppService.CreateAsync(input);
}
public virtual Task<IdentityUserDto> UpdateAsync(Guid id, IdentityUserUpdateDto input)
{
return _userAppService.UpdateAsync(id, input);
}
public virtual Task DeleteAsync(Guid id)
{
return _userAppService.DeleteAsync(id);
}
public virtual Task<ListResultDto<IdentityRoleDto>> GetRolesAsync(Guid id)
{
return _userAppService.GetRolesAsync(id);
}
public virtual Task UpdateRolesAsync(Guid id, IdentityUserUpdateRolesDto input)
{
return _userAppService.UpdateRolesAsync(id, input);
}
public virtual Task<GetPermissionListResultDto> GetPermissionsAsync(Guid id)
{
return _userAppService.GetPermissionsAsync(id);
}
public virtual Task UpdatePermissionsAsync(Guid id, UpdatePermissionsDto input)
{
return _userAppService.UpdatePermissionsAsync(id, input);
}
}
}

2
src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs

@ -13,7 +13,7 @@ using Volo.Abp.VirtualFileSystem;
namespace Volo.Abp.Identity.Web
{
[DependsOn(typeof(AbpIdentityApplicationContractsModule))]
[DependsOn(typeof(AbpIdentityHttpApiModule))]
[DependsOn(typeof(AbpAspNetCoreMvcUiBootstrapModule))]
[DependsOn(typeof(AbpAutoMapperModule))]
[DependsOn(typeof(AbpPermissionsWebModule))]

2
src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj

@ -22,8 +22,8 @@
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj" />
<ProjectReference Include="..\Volo.Abp.Identity.Application.Contracts\Volo.Abp.Identity.Application.Contracts.csproj" />
<ProjectReference Include="..\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
<ProjectReference Include="..\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj" />
<ProjectReference Include="..\Volo.Abp.Permissions.Web\Volo.Abp.Permissions.Web.csproj" />
</ItemGroup>

10
src/Volo.Abp.MultiTenancy.HttpApi/Volo/Abp/MultiTenancy/TenantController.cs

@ -19,27 +19,27 @@ namespace Volo.Abp.MultiTenancy
_service = service;
}
public Task<TenantDto> GetAsync(Guid id)
public virtual Task<TenantDto> GetAsync(Guid id)
{
return _service.GetAsync(id);
}
public Task<PagedResultDto<TenantDto>> GetListAsync(GetTenantsInput input)
public virtual Task<PagedResultDto<TenantDto>> GetListAsync(GetTenantsInput input)
{
return _service.GetListAsync(input);
}
public Task<TenantDto> CreateAsync(TenantCreateDto input)
public virtual Task<TenantDto> CreateAsync(TenantCreateDto input)
{
return _service.CreateAsync(input);
}
public Task<TenantDto> UpdateAsync(Guid id, TenantUpdateDto input)
public virtual Task<TenantDto> UpdateAsync(Guid id, TenantUpdateDto input)
{
return _service.UpdateAsync(id, input);
}
public Task DeleteAsync(Guid id)
public virtual Task DeleteAsync(Guid id)
{
return _service.DeleteAsync(id);
}

Loading…
Cancel
Save