diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs index d400cc1d56..d59c458eb0 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs @@ -58,21 +58,36 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending { Type = TypeHelper.GetFullNameHandlingNullableAndGenerics(propertyConfig.Type), TypeSimple = TypeHelper.GetSimplifiedName(propertyConfig.Type), - Attributes = new List(), + Attributes = new List(), DisplayName = CreateDisplayNameDto(propertyConfig), + Api = new ModuleEntityObjectPropertyExtensionApiConfigurationDto + { + OnGet = new ModuleEntityObjectPropertyExtensionApiGetConfigurationDto + { + IsAvailable = propertyConfig.Api.OnGet.IsAvailable + }, + OnCreate = new ModuleEntityObjectPropertyExtensionApiCreateConfigurationDto + { + IsAvailable = propertyConfig.Api.OnCreate.IsAvailable + }, + OnUpdate = new ModuleEntityObjectPropertyExtensionApiUpdateConfigurationDto + { + IsAvailable = propertyConfig.Api.OnUpdate.IsAvailable + } + }, Ui = new ModuleObjectExtraPropertyUiExtensionDto { - CreateForm = new ModuleObjectExtraPropertyUiFormExtensionDto + OnCreateForm = new ModuleObjectExtraPropertyUiFormExtensionDto { - IsVisible = propertyConfig.UI.CreateForm.IsVisible + IsVisible = propertyConfig.UI.OnCreateForm.IsVisible }, - EditForm = new ModuleObjectExtraPropertyUiFormExtensionDto + OnEditForm = new ModuleObjectExtraPropertyUiFormExtensionDto { - IsVisible = propertyConfig.UI.EditForm.IsVisible + IsVisible = propertyConfig.UI.OnEditForm.IsVisible }, - Table = new ModuleObjectExtraPropertyUiTableExtensionDto + OnTable = new ModuleObjectExtraPropertyUiTableExtensionDto { - IsVisible = propertyConfig.UI.Table.IsVisible + IsVisible = propertyConfig.UI.OnTable.IsVisible } } }; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleEntityObjectPropertyExtensionApiConfiguration.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleEntityObjectPropertyExtensionApiConfiguration.cs new file mode 100644 index 0000000000..9f4d1db42c --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleEntityObjectPropertyExtensionApiConfiguration.cs @@ -0,0 +1,23 @@ +using JetBrains.Annotations; + +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending +{ + public class ModuleEntityObjectPropertyExtensionApiConfigurationDto + { + [NotNull] + public ModuleEntityObjectPropertyExtensionApiGetConfigurationDto OnGet { get; set; } + + [NotNull] + public ModuleEntityObjectPropertyExtensionApiCreateConfigurationDto OnCreate { get; set; } + + [NotNull] + public ModuleEntityObjectPropertyExtensionApiUpdateConfigurationDto OnUpdate { get; set; } + + public ModuleEntityObjectPropertyExtensionApiConfigurationDto() + { + OnGet = new ModuleEntityObjectPropertyExtensionApiGetConfigurationDto(); + OnCreate = new ModuleEntityObjectPropertyExtensionApiCreateConfigurationDto(); + OnUpdate = new ModuleEntityObjectPropertyExtensionApiUpdateConfigurationDto(); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleEntityObjectPropertyExtensionApiCreateConfiguration.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleEntityObjectPropertyExtensionApiCreateConfiguration.cs new file mode 100644 index 0000000000..7cfa9959b0 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleEntityObjectPropertyExtensionApiCreateConfiguration.cs @@ -0,0 +1,13 @@ +using System; + +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending +{ + [Serializable] + public class ModuleEntityObjectPropertyExtensionApiCreateConfigurationDto + { + /// + /// Default: true. + /// + public bool IsAvailable { get; set; } = true; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleEntityObjectPropertyExtensionApiGetConfiguration.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleEntityObjectPropertyExtensionApiGetConfiguration.cs new file mode 100644 index 0000000000..20bf7682c3 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleEntityObjectPropertyExtensionApiGetConfiguration.cs @@ -0,0 +1,13 @@ +using System; + +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending +{ + [Serializable] + public class ModuleEntityObjectPropertyExtensionApiGetConfigurationDto + { + /// + /// Default: true. + /// + public bool IsAvailable { get; set; } = true; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleEntityObjectPropertyExtensionApiUpdateConfiguration.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleEntityObjectPropertyExtensionApiUpdateConfiguration.cs new file mode 100644 index 0000000000..3000965957 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleEntityObjectPropertyExtensionApiUpdateConfiguration.cs @@ -0,0 +1,13 @@ +using System; + +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending +{ + [Serializable] + public class ModuleEntityObjectPropertyExtensionApiUpdateConfigurationDto + { + /// + /// Default: true. + /// + public bool IsAvailable { get; set; } = true; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleObjectExtraPropertyExtensionDto.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleObjectExtraPropertyExtensionDto.cs index 661da59f60..d61c49d327 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleObjectExtraPropertyExtensionDto.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleObjectExtraPropertyExtensionDto.cs @@ -14,6 +14,8 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending [CanBeNull] public LocalizableStringDto DisplayName { get; set; } + public ModuleEntityObjectPropertyExtensionApiConfigurationDto Api { get; set; } + public ModuleObjectExtraPropertyUiExtensionDto Ui { get; set; } public List Attributes { get; set; } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleObjectExtraPropertyUiExtensionDto.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleObjectExtraPropertyUiExtensionDto.cs index fcb39f67c6..8a24a3895c 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleObjectExtraPropertyUiExtensionDto.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ModuleObjectExtraPropertyUiExtensionDto.cs @@ -5,8 +5,8 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending [Serializable] public class ModuleObjectExtraPropertyUiExtensionDto { - public ModuleObjectExtraPropertyUiTableExtensionDto Table { get; set; } - public ModuleObjectExtraPropertyUiFormExtensionDto CreateForm { get; set; } - public ModuleObjectExtraPropertyUiFormExtensionDto EditForm { get; set; } + public ModuleObjectExtraPropertyUiTableExtensionDto OnTable { get; set; } + public ModuleObjectExtraPropertyUiFormExtensionDto OnCreateForm { get; set; } + public ModuleObjectExtraPropertyUiFormExtensionDto OnEditForm { get; set; } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionApiConfiguration.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionApiConfiguration.cs new file mode 100644 index 0000000000..6fdce01246 --- /dev/null +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionApiConfiguration.cs @@ -0,0 +1,23 @@ +using JetBrains.Annotations; + +namespace Volo.Abp.ObjectExtending +{ + public class ModuleEntityObjectPropertyExtensionApiConfiguration + { + [NotNull] + public ModuleEntityObjectPropertyExtensionApiGetConfiguration OnGet { get; } + + [NotNull] + public ModuleEntityObjectPropertyExtensionApiCreateConfiguration OnCreate { get; } + + [NotNull] + public ModuleEntityObjectPropertyExtensionApiUpdateConfiguration OnUpdate { get; } + + public ModuleEntityObjectPropertyExtensionApiConfiguration() + { + OnGet = new ModuleEntityObjectPropertyExtensionApiGetConfiguration(); + OnCreate = new ModuleEntityObjectPropertyExtensionApiCreateConfiguration(); + OnUpdate = new ModuleEntityObjectPropertyExtensionApiUpdateConfiguration(); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionApiCreateConfiguration.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionApiCreateConfiguration.cs new file mode 100644 index 0000000000..9d4c976ce2 --- /dev/null +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionApiCreateConfiguration.cs @@ -0,0 +1,10 @@ +namespace Volo.Abp.ObjectExtending +{ + public class ModuleEntityObjectPropertyExtensionApiCreateConfiguration + { + /// + /// Default: true. + /// + public bool IsAvailable { get; set; } = true; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionApiGetConfiguration.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionApiGetConfiguration.cs new file mode 100644 index 0000000000..bb5ec447d8 --- /dev/null +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionApiGetConfiguration.cs @@ -0,0 +1,10 @@ +namespace Volo.Abp.ObjectExtending +{ + public class ModuleEntityObjectPropertyExtensionApiGetConfiguration + { + /// + /// Default: true. + /// + public bool IsAvailable { get; set; } = true; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionApiUpdateConfiguration.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionApiUpdateConfiguration.cs new file mode 100644 index 0000000000..88b2b5b744 --- /dev/null +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionApiUpdateConfiguration.cs @@ -0,0 +1,10 @@ +namespace Volo.Abp.ObjectExtending +{ + public class ModuleEntityObjectPropertyExtensionApiUpdateConfiguration + { + /// + /// Default: true. + /// + public bool IsAvailable { get; set; } = true; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionConfiguration.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionConfiguration.cs index ac4d7ad73f..0259dce5d0 100644 --- a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionConfiguration.cs +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionConfiguration.cs @@ -30,6 +30,9 @@ namespace Volo.Abp.ObjectExtending [NotNull] public ModuleEntityObjectPropertyExtensionUIConfiguration UI { get; } + + [NotNull] + public ModuleEntityObjectPropertyExtensionApiConfiguration Api { get; } public ModuleEntityObjectPropertyExtensionConfiguration( [NotNull] ModuleEntityObjectExtensionConfiguration entityObjectExtensionConfiguration, @@ -45,6 +48,7 @@ namespace Volo.Abp.ObjectExtending Validators = new List>(); UI = new ModuleEntityObjectPropertyExtensionUIConfiguration(); + Api = new ModuleEntityObjectPropertyExtensionApiConfiguration(); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionUIConfiguration.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionUIConfiguration.cs index 352b714ff0..64270be7fa 100644 --- a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionUIConfiguration.cs +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleEntityObjectPropertyExtensionUIConfiguration.cs @@ -5,19 +5,19 @@ namespace Volo.Abp.ObjectExtending public class ModuleEntityObjectPropertyExtensionUIConfiguration { [NotNull] - public ModuleEntityObjectPropertyExtensionUITableConfiguration Table { get; } + public ModuleEntityObjectPropertyExtensionUITableConfiguration OnTable { get; } [NotNull] - public ModuleEntityObjectPropertyExtensionUIFormConfiguration CreateForm { get; } + public ModuleEntityObjectPropertyExtensionUIFormConfiguration OnCreateForm { get; } [NotNull] - public ModuleEntityObjectPropertyExtensionUIFormConfiguration EditForm { get; } + public ModuleEntityObjectPropertyExtensionUIFormConfiguration OnEditForm { get; } public ModuleEntityObjectPropertyExtensionUIConfiguration() { - Table = new ModuleEntityObjectPropertyExtensionUITableConfiguration(); - CreateForm = new ModuleEntityObjectPropertyExtensionUIFormConfiguration(); - EditForm = new ModuleEntityObjectPropertyExtensionUIFormConfiguration(); + OnTable = new ModuleEntityObjectPropertyExtensionUITableConfiguration(); + OnCreateForm = new ModuleEntityObjectPropertyExtensionUIFormConfiguration(); + OnEditForm = new ModuleEntityObjectPropertyExtensionUIFormConfiguration(); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleObjectExtensionConfigurationHelper.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleObjectExtensionConfigurationHelper.cs index b8ab6b5516..91a329d984 100644 --- a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleObjectExtensionConfigurationHelper.cs +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ModuleObjectExtensionConfigurationHelper.cs @@ -10,22 +10,43 @@ namespace Volo.Abp.ObjectExtending string moduleName, string objectName, Type[] createFormTypes = null, - Type[] editFormTypes = null + Type[] editFormTypes = null, + Type[] getApiTypes = null, + Type[] createApiTypes = null, + Type[] updateApiTypes = null ) { foreach (var propertyConfig in GetPropertyConfigurations(moduleName, objectName)) { - if (propertyConfig.UI.CreateForm.IsVisible && + if (propertyConfig.UI.OnCreateForm.IsVisible && createFormTypes != null) { ApplyPropertyConfigurationToTypes(propertyConfig, createFormTypes); } - if (propertyConfig.UI.EditForm.IsVisible && + if (propertyConfig.UI.OnEditForm.IsVisible && editFormTypes != null) { ApplyPropertyConfigurationToTypes(propertyConfig, editFormTypes); } + + if (propertyConfig.Api.OnGet.IsAvailable && + getApiTypes != null) + { + ApplyPropertyConfigurationToTypes(propertyConfig, getApiTypes); + } + + if (propertyConfig.Api.OnCreate.IsAvailable && + createApiTypes != null) + { + ApplyPropertyConfigurationToTypes(propertyConfig, createApiTypes); + } + + if (propertyConfig.Api.OnUpdate.IsAvailable && + updateApiTypes != null) + { + ApplyPropertyConfigurationToTypes(propertyConfig, updateApiTypes); + } } }