|
|
@ -74,16 +74,29 @@ public class AbpServiceConvention : IAbpServiceConvention, ITransientDependency |
|
|
|
|
|
|
|
|
protected virtual void RemoveIntegrationControllersIfNotExposed(ApplicationModel application) |
|
|
protected virtual void RemoveIntegrationControllersIfNotExposed(ApplicationModel application) |
|
|
{ |
|
|
{ |
|
|
if (Options.ExposeIntegrationServices) |
|
|
if (!Options.ExposeIntegrationServices) |
|
|
{ |
|
|
{ |
|
|
return; |
|
|
var integrationControllers = GetControllers(application) |
|
|
|
|
|
.Where(c => IntegrationServiceAttribute.IsDefinedOrInherited(c.ControllerType)) |
|
|
|
|
|
.ToArray(); |
|
|
|
|
|
|
|
|
|
|
|
application.Controllers.RemoveAll(integrationControllers); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!Options.ExposeClientProxyServices) |
|
|
|
|
|
{ |
|
|
|
|
|
var clientProxyServiceControllers = GetControllers(application) |
|
|
|
|
|
.Where(c => IsClientProxyService(c.ControllerType)) |
|
|
|
|
|
.ToArray(); |
|
|
|
|
|
|
|
|
|
|
|
application.Controllers.RemoveAll(clientProxyServiceControllers); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
var integrationControllers = GetControllers(application) |
|
|
|
|
|
.Where(c => IntegrationServiceAttribute.IsDefinedOrInherited(c.ControllerType)) |
|
|
|
|
|
.ToArray(); |
|
|
|
|
|
|
|
|
|
|
|
application.Controllers.RemoveAll(integrationControllers); |
|
|
protected virtual bool IsClientProxyService(Type controllerType) |
|
|
|
|
|
{ |
|
|
|
|
|
return typeof(IApplicationService).IsAssignableFrom(controllerType) && |
|
|
|
|
|
controllerType.GetBaseClasses().Any(x => x.IsGenericType && x.GetGenericTypeDefinition().FullName!.StartsWith("Volo.Abp.Http.Client.ClientProxying.ClientProxyBase")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected virtual IList<ControllerModel> GetControllers(ApplicationModel application) |
|
|
protected virtual IList<ControllerModel> GetControllers(ApplicationModel application) |
|
|
|