diff --git a/host/src/Sample.EntityFrameworkCore/Sample.EntityFrameworkCore.csproj b/host/src/Sample.EntityFrameworkCore/Sample.EntityFrameworkCore.csproj index 05c03ff..58d2c73 100644 --- a/host/src/Sample.EntityFrameworkCore/Sample.EntityFrameworkCore.csproj +++ b/host/src/Sample.EntityFrameworkCore/Sample.EntityFrameworkCore.csproj @@ -26,7 +26,8 @@ - + + all runtime; build; native; contentfiles; analyzers diff --git a/host/src/Sample.HttpApi.Host/SampleHttpApiHostModule.cs b/host/src/Sample.HttpApi.Host/SampleHttpApiHostModule.cs index 14c4fc6..5ee4d64 100644 --- a/host/src/Sample.HttpApi.Host/SampleHttpApiHostModule.cs +++ b/host/src/Sample.HttpApi.Host/SampleHttpApiHostModule.cs @@ -187,8 +187,12 @@ private void ConfigureConventionalControllers() private static void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration) { + var authority = configuration["AuthServer:Authority"]; + if (string.IsNullOrWhiteSpace(authority)) + return; + context.Services.AddAbpSwaggerGenWithOAuth( - configuration["AuthServer:Authority"], + authority, new Dictionary { {"Sample", "Sample API"} diff --git a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountAdminSettingsController.cs b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountAdminSettingsController.cs index a2834ae..a774b2a 100644 --- a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountAdminSettingsController.cs +++ b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountAdminSettingsController.cs @@ -1,12 +1,13 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp; +using Volo.Abp.AspNetCore.Mvc; namespace Passingwind.Abp.Account; [RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] [Area(AccountRemoteServiceConsts.ModuleName)] [Route("/api/account/admin/settings")] -public class AccountAdminSettingsController : AccountBaseController, IAccountAdminSettingsAppService +public class AccountAdminSettingsController : AbpControllerBase, IAccountAdminSettingsAppService { private readonly IAccountAdminSettingsAppService _service; diff --git a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountAuthenticationLoginController.cs b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountAuthenticationLoginController.cs index dc79932..e86d9aa 100644 --- a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountAuthenticationLoginController.cs +++ b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountAuthenticationLoginController.cs @@ -2,13 +2,14 @@ using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; namespace Passingwind.Abp.Account; [RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] [Area(AccountRemoteServiceConsts.ModuleName)] [Route("api/account/authentication/logins")] -public class AccountAuthenticationLoginController : AccountBaseController, IAccountAuthenticationLoginAppService +public class AccountAuthenticationLoginController : AbpControllerBase, IAccountAuthenticationLoginAppService { protected IAccountAuthenticationLoginAppService Service { get; } diff --git a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountBaseController.cs b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountBaseController.cs deleted file mode 100644 index 2da45ef..0000000 --- a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountBaseController.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Passingwind.Abp.Account.Localization; -using Volo.Abp.AspNetCore.Mvc; - -namespace Passingwind.Abp.Account; - -public abstract class AccountBaseController : AbpControllerBase -{ - protected AccountBaseController() - { - LocalizationResource = typeof(AccountResource); - } -} diff --git a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountClaimsController.cs b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountClaimsController.cs index 2454488..97aeaff 100644 --- a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountClaimsController.cs +++ b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountClaimsController.cs @@ -2,13 +2,14 @@ using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; namespace Passingwind.Abp.Account; [RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] [Area(AccountRemoteServiceConsts.ModuleName)] [Route("api/account/claims")] -public class AccountClaimsController : AccountBaseController, IAccountClaimsAppService +public class AccountClaimsController : AbpControllerBase, IAccountClaimsAppService { protected IAccountClaimsAppService Service { get; } diff --git a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountDynamicClaimsController.cs b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountDynamicClaimsController.cs new file mode 100644 index 0000000..9d4185d --- /dev/null +++ b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountDynamicClaimsController.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Account; +using Volo.Abp.AspNetCore.Mvc; + +namespace Passingwind.Abp.Account; + +[RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] +[Area(AccountRemoteServiceConsts.ModuleName)] +[Route("/api/account/dynamic-claims")] +public class AccountDynamicClaimsController : AbpControllerBase, IDynamicClaimsAppService +{ + protected IDynamicClaimsAppService DynamicClaimsAppService { get; } + + public AccountDynamicClaimsController(IDynamicClaimsAppService dynamicClaimsAppService) + { + DynamicClaimsAppService = dynamicClaimsAppService; + } + + [HttpPost] + [Route("refresh")] + public virtual Task RefreshAsync() + { + return DynamicClaimsAppService.RefreshAsync(); + } +} diff --git a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountExternalController.cs b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountExternalController.cs index 9a22f12..a3fc16e 100644 --- a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountExternalController.cs +++ b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountExternalController.cs @@ -2,6 +2,7 @@ using JetBrains.Annotations; using Microsoft.AspNetCore.Mvc; using Volo.Abp; +using Volo.Abp.AspNetCore.Mvc; namespace Passingwind.Abp.Account; @@ -9,7 +10,7 @@ namespace Passingwind.Abp.Account; [RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] [Area(AccountRemoteServiceConsts.ModuleName)] [Route("api/account/external")] -public class AccountExternalController : AccountBaseController, IAccountExternalAppService +public class AccountExternalController : AbpControllerBase, IAccountExternalAppService { protected IAccountExternalAppService ExternalAppService { get; } diff --git a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountImpersonationController.cs b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountImpersonationController.cs index 46fe08f..274b010 100644 --- a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountImpersonationController.cs +++ b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountImpersonationController.cs @@ -2,13 +2,14 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp; +using Volo.Abp.AspNetCore.Mvc; namespace Passingwind.Abp.Account; [RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] [Area(AccountRemoteServiceConsts.ModuleName)] [Route("api/account/impersonation")] -public class AccountImpersonationController : AccountBaseController, IAccountImpersonationAppService +public class AccountImpersonationController : AbpControllerBase, IAccountImpersonationAppService { private readonly IAccountImpersonationAppService _service; diff --git a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountLinkUserController.cs b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountLinkUserController.cs index 108f35a..e99a74a 100644 --- a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountLinkUserController.cs +++ b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountLinkUserController.cs @@ -3,13 +3,14 @@ using Passingwind.Abp.Account; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; namespace Passingwind.Abp.Identity; [RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] [Area(AccountRemoteServiceConsts.ModuleName)] [Route("api/account/link-user")] -public class AccountLinkUserController : AccountBaseController, IAccountLinkUserAppService +public class AccountLinkUserController : AbpControllerBase, IAccountLinkUserAppService { private readonly IAccountLinkUserAppService _service; diff --git a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountLoginController.cs b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountLoginController.cs index f1f308c..171cd82 100644 --- a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountLoginController.cs +++ b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountLoginController.cs @@ -3,13 +3,14 @@ using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; namespace Passingwind.Abp.Account; [Area(AccountRemoteServiceConsts.RemoteServiceName)] [RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] [Route("api/account")] -public class AccountLoginController : AccountBaseController, IAccountLoginAppService +public class AccountLoginController : AbpControllerBase, IAccountLoginAppService { private readonly IAccountLoginAppService _service; diff --git a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountSecurityLogsController.cs b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountSecurityLogsController.cs index b922ce1..07cb985 100644 --- a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountSecurityLogsController.cs +++ b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountSecurityLogsController.cs @@ -3,13 +3,14 @@ using Passingwind.Abp.Identity; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; namespace Passingwind.Abp.Account; [RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] [Area(AccountRemoteServiceConsts.ModuleName)] [Route("/api/account/security-logs")] -public class AccountSecurityLogsController : AccountBaseController, IAccountSecurityLogsAppService +public class AccountSecurityLogsController : AbpControllerBase, IAccountSecurityLogsAppService { private readonly IAccountSecurityLogsAppService _service; diff --git a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountTfaController.cs b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountTfaController.cs index 055b1a2..b21b2c9 100644 --- a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountTfaController.cs +++ b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountTfaController.cs @@ -2,12 +2,13 @@ using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; namespace Passingwind.Abp.Account; [RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] [Area(AccountRemoteServiceConsts.ModuleName)] [Route("/api/account/2fa")] -public class AccountTfaController : AccountBaseController, IAccountTfaAppService +public class AccountTfaController : AbpControllerBase, IAccountTfaAppService { protected IAccountTfaAppService TfaAppService { get; } diff --git a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountUserDelegationController.cs b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountUserDelegationController.cs index 0656baf..03ac1f2 100644 --- a/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountUserDelegationController.cs +++ b/modules/account/src/Passingwind.Abp.Account.HttpApi/AccountUserDelegationController.cs @@ -3,13 +3,14 @@ using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; namespace Passingwind.Abp.Account; [RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] [Area(AccountRemoteServiceConsts.ModuleName)] [Route("api/account/user-delegation")] -public class AccountUserDelegationController : AccountBaseController, IAccountUserDelegationAppService +public class AccountUserDelegationController : AbpControllerBase, IAccountUserDelegationAppService { private readonly IAccountUserDelegationAppService _service;