How to replace or Customize AccountController
Hi,
I want to customize existing abp AccountController on this route api/account, is it possible? I want to customize the register method in this controller and add some extra conditions.
Is this the controller?
https://github.com/abpframework/abp/blob/ac582a519ac76e1bce0b892cc52587b1976f0f51/modules/account/src/Volo.Abp.Account.HttpApi/Volo/Abp/Account/AccountController.cs#L11
Is this the controller?
https://github.com/abpframework/abp/blob/ac582a519ac76e1bce0b892cc52587b1976f0f51/modules/account/src/Volo.Abp.Account.HttpApi/Volo/Abp/Account/AccountController.cs#L11
@maliming Yes, this is my app dependencies:
[DependsOn(
typeof(AbpAutofacModule),
typeof(AbpAutoMapperModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpLdapModule)
)]
why swagger generate other api definition like Account api or Tenant Api? I don't have dependency to these modules.

AccountController just calls IAccountAppService. You can replace IAccountAppService.
why swagger generate other api definition like Account api or Tenant Api? I don't have dependency to these modules.
The account module depends on the identity module.
Ok, Replacing IAccountAppService is a good idea, but as I said I removed both the Identity module and account module from my app dependencies for test purpose, but swagger still generates docs for these APIs !
[DependsOn(
typeof(AbpAutofacModule),
typeof(AbpAutoMapperModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpLdapModule)
)]
here I don't have any dependecies to account or identity but swagger docs will generate.
I have one question related to replacing the AccountController.
I need to override de login from Account,
but it uses AccountController from Volo.Abp.Account.Web.Areas.Account.Controllers, not the one in the comments (https://github.com/abpframework/abp/issues/3132#issuecomment-599363769)
and it doesn't call IAccountAppService (this one doesn't have login)
I tried to create another AbpController pointing to the same route and inheritingAccountController but swagger gives error because duplicated endpoints.
How can I replace the "original" login endpoint? because this is which my angular app points to.

@luisp88
Overriding controllers, framework services, view component classes and any other type of classes registered to dependency injection can be overridden just like the examples above.
https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Overriding-Services
@maliming Do you have any solution for the swagger problem that I mentioned above?
@mehdihadeli Can you provider a test project?
I moved my swagger problem to a new thread here: https://github.com/abpframework/abp/issues/3335 My problem for this thread resolved with @maliming guides, thanks.
@maliming If I want to replace also AccountController instead of just replacing AccountAppService because I have different input dto, for example, ExtendedRegisterDto for RegisterAsync method, what I do?
In this link that you mentioned, there is no sample for the controller. https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Overriding-Services
because I have different input dto, for example, ExtendedRegisterDto for RegisterAsync method, what I do?
Please follow: https://github.com/abpframework/abp/issues/3405
Ok thanks.