From 25ae6e53b5c7a7a580558ba499f648b63a2d30a3 Mon Sep 17 00:00:00 2001 From: colin Date: Wed, 26 Aug 2026 14:19:39 +0800 Subject: [PATCH] feat: Optimize the definition interface --- .../AI/Internal/DeepSeekChatClientProvider.cs | 5 +++-- .../AI/Internal/OpenAIChatClientProvider.cs | 11 +++++------ .../Tools/Dtos/AIToolDefinitionRecordDto.cs | 2 ++ .../Dtos/WorkspaceDefinitionRecordDto.cs | 2 ++ .../AbpAIManagementApplicationMappers.cs | 16 ++++++++++++++++ .../Tools/AIToolDefinitionAppService.cs | 7 ++++++- .../WorkspaceDefinitionAppService.cs | 7 ++++++- .../Localization/Resources/en.json | 3 ++- .../Localization/Resources/zh-Hans.json | 3 ++- .../Definitions/FeatureDefinitionAppService.cs | 15 ++++++++++++--- .../FeatureGroupDefinitionAppService.cs | 15 ++++++++++++--- .../PermissionDefinitionAppService.cs | 15 +++++++++++---- .../PermissionGroupDefinitionAppService.cs | 14 +++++++++++--- .../NotificationGroupDefinitionAppService.cs | 18 +++++++++++++----- .../NotificationDefinitionAppService.cs | 14 +++++++++++--- .../SettingDefinitionAppService.cs | 15 +++++++++++---- .../Localization/Resources/en.json | 2 +- .../Localization/Resources/zh-Hans.json | 2 +- .../Definitions/WebhookDefinitionAppService.cs | 14 ++++++++++++-- .../WebhookGroupDefinitionAppService.cs | 15 ++++++++++++--- 20 files changed, 151 insertions(+), 44 deletions(-) diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AI.Core/LINGYUN/Abp/AI/Internal/DeepSeekChatClientProvider.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AI.Core/LINGYUN/Abp/AI/Internal/DeepSeekChatClientProvider.cs index d2af9d566..4e1a895da 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AI.Core/LINGYUN/Abp/AI/Internal/DeepSeekChatClientProvider.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AI.Core/LINGYUN/Abp/AI/Internal/DeepSeekChatClientProvider.cs @@ -17,8 +17,9 @@ public class DeepSeekChatClientProvider : OpenAIChatClientProvider public override ChatModel[] GetModels() { return [ - new ChatModel("deepseek-chat", "DeepSeek-V3", "DeepSeek-Chat是全能高效的“快枪手”,擅长日常对话与通用任务"), - new ChatModel("deepseek-reasoner", "DeepSeek-R1", "DeepSeek-Reasoner是深思熟虑的“解题家”,专攻复杂推理与逻辑难题"), + new ChatModel("deepseek-v4-flash", "deepseek-v4-flash"), + new ChatModel("deepseek-v4-pro", "deepseek-v4-pro"), + new ChatModel("deepseek-v4-flash-vision-exp", "deepseek-v4-flash-vision-exp"), ]; } } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AI.Core/LINGYUN/Abp/AI/Internal/OpenAIChatClientProvider.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AI.Core/LINGYUN/Abp/AI/Internal/OpenAIChatClientProvider.cs index 3502539de..1b57e603e 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AI.Core/LINGYUN/Abp/AI/Internal/OpenAIChatClientProvider.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AI.Core/LINGYUN/Abp/AI/Internal/OpenAIChatClientProvider.cs @@ -24,12 +24,11 @@ public class OpenAIChatClientProvider : ChatClientProvider public override ChatModel[] GetModels() { return [ - new ChatModel("gpt-4.1", "GPT-4.1", "Smartest non-reasoning model"), - new ChatModel("gpt-5", "GPT-5", "Previous intelligent reasoning model for coding and agentic tasks with configurable reasoning effort"), - new ChatModel("gpt-5-nano", "GPT-5 nano", "Fastest, most cost-efficient version of GPT-5"), - new ChatModel("gpt-5-mini", "GPT-5 mini", "Near-frontier intelligence for cost sensitive, low latency, high volume workloads"), - new ChatModel("gpt-5.4", "GPT-5.4", "Best intelligence at scale for agentic, coding, and professional workflows"), - new ChatModel("gpt-5.4-pro", "GPT-5.4 pro", "Version of GPT-5.4 that produces smarter and more precise responses."), + new ChatModel("gpt-5.4", "gpt-5.4"), + new ChatModel("gpt-5.4-mini", "gpt-5.4-mini"), + new ChatModel("gpt-5.4-nano", "gpt-5.4-nano"), + new ChatModel("gpt-5.5", "gpt-5.5"), + new ChatModel("gpt-5.5-pro", "gpt-5.5-pro"), ]; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordDto.cs index e6281f7b4..c47b0d83c 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordDto.cs @@ -19,6 +19,8 @@ public class AIToolDefinitionRecordDto : ExtensibleAuditedEntityDto, IHasC public bool IsGlobal { get; set; } + public bool IsStatic { get; set; } + public string? StateCheckers { get; set; } public string ConcurrencyStamp { get; set; } = default!; diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordDto.cs index 1e62f15d5..ddf5f6fe8 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordDto.cs @@ -35,6 +35,8 @@ public class WorkspaceDefinitionRecordDto : ExtensibleAuditedEntityDto, IH public bool IsSystem { get; set; } + public bool IsStatic { get; set; } + public string[]? Tools { get; set; } public string? StateCheckers { get; set; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN/Abp/AIManagement/AbpAIManagementApplicationMappers.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN/Abp/AIManagement/AbpAIManagementApplicationMappers.cs index dc0e6377b..1016cdff8 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN/Abp/AIManagement/AbpAIManagementApplicationMappers.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN/Abp/AIManagement/AbpAIManagementApplicationMappers.cs @@ -6,6 +6,7 @@ using LINGYUN.Abp.AIManagement.Workspaces; using LINGYUN.Abp.AIManagement.Workspaces.Dtos; using Riok.Mapperly.Abstractions; using System; +using Volo.Abp.Data; using Volo.Abp.Mapperly; using Volo.Abp.ObjectExtending; @@ -16,9 +17,11 @@ namespace LINGYUN.Abp.AIManagement; public partial class WorkspaceDefinitionRecordToWorkspaceDefinitionRecordDtoMapper : MapperBase { [MapPropertyFromSource(nameof(WorkspaceDefinitionRecordDto.Tools), Use = nameof(ConvertTools))] + [MapperIgnoreTarget(nameof(WorkspaceDefinitionRecordDto.IsStatic))] public override partial WorkspaceDefinitionRecordDto Map(WorkspaceDefinitionRecord source); [MapPropertyFromSource(nameof(WorkspaceDefinitionRecordDto.Tools), Use = nameof(ConvertTools))] + [MapperIgnoreTarget(nameof(WorkspaceDefinitionRecordDto.IsStatic))] public override partial void Map(WorkspaceDefinitionRecord source, WorkspaceDefinitionRecordDto destination); [UserMapping(Default = false)] @@ -26,6 +29,11 @@ public partial class WorkspaceDefinitionRecordToWorkspaceDefinitionRecordDtoMapp { return !record.Tools.IsNullOrWhiteSpace() ? record.Tools.Split(",") : []; } + + public override void AfterMap(WorkspaceDefinitionRecord source, WorkspaceDefinitionRecordDto destination) + { + destination.IsStatic = source.GetProperty(nameof(WorkspaceDefinitionRecordDto.IsStatic), true); + } } [Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] @@ -49,6 +57,14 @@ public partial class TextChatMessageRecordToTextChatMessageDtoMapper : MapperBas [MapExtraProperties(DefinitionChecks = MappingPropertyDefinitionChecks.None)] public partial class AIToolDefinitionRecordToAIToolDefinitionRecordDtoMapper : MapperBase { + [MapperIgnoreTarget(nameof(AIToolDefinitionRecordDto.IsStatic))] public override partial AIToolDefinitionRecordDto Map(AIToolDefinitionRecord source); + + [MapperIgnoreTarget(nameof(AIToolDefinitionRecordDto.IsStatic))] public override partial void Map(AIToolDefinitionRecord source, AIToolDefinitionRecordDto destination); + + public override void AfterMap(AIToolDefinitionRecord source, AIToolDefinitionRecordDto destination) + { + destination.IsStatic = source.GetProperty(nameof(AIToolDefinitionRecordDto.IsStatic), true); + } } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN/Abp/AIManagement/Tools/AIToolDefinitionAppService.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN/Abp/AIManagement/Tools/AIToolDefinitionAppService.cs index 7b4265a97..bbab08b6c 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN/Abp/AIManagement/Tools/AIToolDefinitionAppService.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN/Abp/AIManagement/Tools/AIToolDefinitionAppService.cs @@ -2,6 +2,7 @@ using LINGYUN.Abp.AIManagement.Localization; using LINGYUN.Abp.AIManagement.Permissions; using LINGYUN.Abp.AIManagement.Tools.Dtos; +using LINGYUN.Abp.AIManagement.Workspaces.Dtos; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using System; @@ -12,7 +13,6 @@ using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Data; -using Volo.Abp.Domain.Entities; namespace LINGYUN.Abp.AIManagement.Tools; public class AIToolDefinitionAppService : @@ -133,6 +133,7 @@ public class AIToolDefinitionAppService : entity.ExtraProperties.Add(property.Key, property.Value); } } + entity.SetProperty(nameof(AIToolDefinitionRecordDto.IsStatic), false); return entity; } @@ -156,12 +157,16 @@ public class AIToolDefinitionAppService : if (!entity.HasSameExtraProperties(updateInput)) { + var isStatic = entity.GetProperty(nameof(AIToolDefinitionRecordDto.IsStatic), true); + entity.ExtraProperties.Clear(); foreach (var property in updateInput.ExtraProperties) { entity.ExtraProperties.Add(property.Key, property.Value); } + + entity.SetProperty(nameof(AIToolDefinitionRecordDto.IsStatic), isStatic); } entity.SetConcurrencyStampIfNotNull(updateInput.ConcurrencyStamp); diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionAppService.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionAppService.cs index f4337fb02..76d98874a 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionAppService.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionAppService.cs @@ -13,7 +13,6 @@ using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Data; -using Volo.Abp.Domain.Entities; using Volo.Abp.Security.Encryption; namespace LINGYUN.Abp.AIManagement.Workspaces; @@ -137,6 +136,8 @@ public class WorkspaceDefinitionAppService : } } + entity.SetProperty(nameof(WorkspaceDefinitionRecordDto.IsStatic), false); + return entity; } @@ -210,12 +211,16 @@ public class WorkspaceDefinitionAppService : if (!entity.HasSameExtraProperties(updateInput)) { + var isStatic = entity.GetProperty(nameof(WorkspaceDefinitionRecordDto.IsStatic), true); + entity.ExtraProperties.Clear(); foreach (var property in updateInput.ExtraProperties) { entity.ExtraProperties.Add(property.Key, property.Value); } + + entity.SetProperty(nameof(WorkspaceDefinitionRecordDto.IsStatic), isStatic); } entity.SetConcurrencyStampIfNotNull(updateInput.ConcurrencyStamp); diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Localization/Resources/en.json b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Localization/Resources/en.json index 5eb375163..f8d407937 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Localization/Resources/en.json +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Localization/Resources/en.json @@ -62,6 +62,7 @@ "Tools:Edit": "Edit Tool", "DesignConversationNamePrompt": "Based on the user's question, generate a concise and descriptive conversation title, with the length limited to {0} characters or less.", "Settings:AIManagement": "Artificia Intelligence", - "Settings:AIManagement.ChatMessage": "Chats" + "Settings:AIManagement.ChatMessage": "Chats", + "ResetApiKey": "Reset Api Key" } } \ No newline at end of file diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Localization/Resources/zh-Hans.json b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Localization/Resources/zh-Hans.json index 5c97079d8..d647d728c 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Localization/Resources/zh-Hans.json +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Localization/Resources/zh-Hans.json @@ -62,6 +62,7 @@ "Tools:Edit": "编辑工具", "DesignConversationNamePrompt": "根据用户的提问, 生成一个简短且具有描述性的对话名称, 长度必须控制在 {0} 个字符以内.", "Settings:AIManagement": "人工智能", - "Settings:AIManagement.ChatMessage": "对话管理" + "Settings:AIManagement.ChatMessage": "对话管理", + "ResetApiKey": "重置Api Key" } } \ No newline at end of file diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureDefinitionAppService.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureDefinitionAppService.cs index 3fa0cdaa9..f08c1b017 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureDefinitionAppService.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureDefinitionAppService.cs @@ -193,10 +193,19 @@ public class FeatureDefinitionAppService : FeatureManagementAppServiceBase, IFea { record.AllowedProviders = allowedProviders; } - record.ExtraProperties.Clear(); - foreach (var property in input.ExtraProperties) + + if (!record.HasSameExtraProperties(input)) { - record.SetProperty(property.Key, property.Value); + var isStatic = record.GetProperty(nameof(FeatureDefinitionDto.IsStatic), true); + + record.ExtraProperties.Clear(); + + foreach (var property in input.ExtraProperties) + { + record.ExtraProperties.Add(property.Key, property.Value); + } + + record.SetProperty(nameof(FeatureDefinitionDto.IsStatic), isStatic); } try { diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureGroupDefinitionAppService.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureGroupDefinitionAppService.cs index 88787d877..75be6f304 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureGroupDefinitionAppService.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureGroupDefinitionAppService.cs @@ -131,11 +131,20 @@ public class FeatureGroupDefinitionAppService : FeatureManagementAppServiceBase, protected virtual void UpdateByInput(FeatureGroupDefinitionRecord record, FeatureGroupDefinitionCreateOrUpdateDto input) { - record.ExtraProperties.Clear(); - foreach (var property in input.ExtraProperties) + if (!record.HasSameExtraProperties(input)) { - record.SetProperty(property.Key, property.Value); + var isStatic = record.GetProperty(nameof(FeatureGroupDefinitionDto.IsStatic), true); + + record.ExtraProperties.Clear(); + + foreach (var property in input.ExtraProperties) + { + record.ExtraProperties.Add(property.Key, property.Value); + } + + record.SetProperty(nameof(FeatureGroupDefinitionDto.IsStatic), isStatic); } + if (!string.Equals(record.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) { record.DisplayName = input.DisplayName; diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionDefinitionAppService.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionDefinitionAppService.cs index 04859c389..eefdeada3 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionDefinitionAppService.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionDefinitionAppService.cs @@ -197,11 +197,18 @@ public class PermissionDefinitionAppService : PermissionManagementAppServiceBase { record.Providers = providers; } - - record.ExtraProperties.Clear(); - foreach (var property in input.ExtraProperties) + if (!record.HasSameExtraProperties(input)) { - record.SetProperty(property.Key, property.Value); + var isStatic = record.GetProperty(nameof(PermissionDefinitionDto.IsStatic), true); + + record.ExtraProperties.Clear(); + + foreach (var property in input.ExtraProperties) + { + record.ExtraProperties.Add(property.Key, property.Value); + } + + record.SetProperty(nameof(PermissionDefinitionDto.IsStatic), isStatic); } try diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionGroupDefinitionAppService.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionGroupDefinitionAppService.cs index 13b0e1bf3..535a91d8c 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionGroupDefinitionAppService.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionGroupDefinitionAppService.cs @@ -144,10 +144,18 @@ public class PermissionGroupDefinitionAppService : PermissionManagementAppServic protected virtual void UpdateByInput(PermissionGroupDefinitionRecord record, PermissionGroupDefinitionCreateOrUpdateDto input) { - record.ExtraProperties.Clear(); - foreach (var property in input.ExtraProperties) + if (!record.HasSameExtraProperties(input)) { - record.SetProperty(property.Key, property.Value); + var isStatic = record.GetProperty(nameof(PermissionGroupDefinitionDto.IsStatic), true); + + record.ExtraProperties.Clear(); + + foreach (var property in input.ExtraProperties) + { + record.ExtraProperties.Add(property.Key, property.Value); + } + + record.SetProperty(nameof(PermissionGroupDefinitionDto.IsStatic), isStatic); } if (!string.Equals(record.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) { diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Groups/NotificationGroupDefinitionAppService.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Groups/NotificationGroupDefinitionAppService.cs index c392dc17e..b7f2b8ffe 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Groups/NotificationGroupDefinitionAppService.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Groups/NotificationGroupDefinitionAppService.cs @@ -120,11 +120,6 @@ public class NotificationGroupDefinitionAppService : AbpNotificationsApplication protected virtual void UpdateByInput(NotificationDefinitionGroupRecord record, NotificationGroupDefinitionCreateOrUpdateDto input) { record.AllowSubscriptionToClients = input.AllowSubscriptionToClients; - record.ExtraProperties.Clear(); - foreach (var property in input.ExtraProperties) - { - record.SetProperty(property.Key, property.Value); - } if (!string.Equals(record.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) { @@ -134,6 +129,19 @@ public class NotificationGroupDefinitionAppService : AbpNotificationsApplication { record.Description = input.Description; } + if (!record.HasSameExtraProperties(input)) + { + var isStatic = record.GetProperty(nameof(NotificationGroupDefinitionDto.IsStatic), true); + + record.ExtraProperties.Clear(); + + foreach (var property in input.ExtraProperties) + { + record.ExtraProperties.Add(property.Key, property.Value); + } + + record.SetProperty(nameof(NotificationGroupDefinitionDto.IsStatic), isStatic); + } } protected async virtual Task FindByNameAsync(string name) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Notifications/NotificationDefinitionAppService.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Notifications/NotificationDefinitionAppService.cs index ecddbef2f..4922c3d6a 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Notifications/NotificationDefinitionAppService.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Notifications/NotificationDefinitionAppService.cs @@ -172,10 +172,18 @@ public class NotificationDefinitionAppService : AbpNotificationsApplicationServi { record.Providers = allowedProviders; } - record.ExtraProperties.Clear(); - foreach (var property in input.ExtraProperties) + if (!record.HasSameExtraProperties(input)) { - record.SetProperty(property.Key, property.Value); + var isStatic = record.GetProperty(nameof(NotificationDefinitionDto.IsStatic), true); + + record.ExtraProperties.Clear(); + + foreach (var property in input.ExtraProperties) + { + record.ExtraProperties.Add(property.Key, property.Value); + } + + record.SetProperty(nameof(NotificationDefinitionDto.IsStatic), isStatic); } } diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingDefinitionAppService.cs b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingDefinitionAppService.cs index f454a0ef3..a2a8af0e0 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingDefinitionAppService.cs +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingDefinitionAppService.cs @@ -196,11 +196,18 @@ public class SettingDefinitionAppService : SettingManagementAppServiceBase, ISet record.IsEncrypted = input.IsEncrypted; record.IsVisibleToClients = input.IsVisibleToClients; record.Providers = input.Providers?.JoinAsString(","); - record.ExtraProperties.Clear(); - - foreach (var property in input.ExtraProperties) + if (!record.HasSameExtraProperties(input)) { - record.ExtraProperties.Add(property.Key, property.Value); + var isStatic = record.GetProperty(nameof(SettingDefinitionDto.IsStatic), true); + + record.ExtraProperties.Clear(); + + foreach (var property in input.ExtraProperties) + { + record.ExtraProperties.Add(property.Key, property.Value); + } + + record.SetProperty(nameof(SettingDefinitionDto.IsStatic), isStatic); } } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/Resources/en.json b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/Resources/en.json index c879c78e1..002a90b9b 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/Resources/en.json +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/Resources/en.json @@ -38,7 +38,7 @@ "TemplateContentUpdated": "The template content has been updated", "TemplateContentRestoredToDefault": "The template content is restored to the default value.", "CustomizePerCulture": "Customize per culture", - "InlineContentDescription": "This template uses inline localization. You can use the L<\/b> function to localize a text, like {{L \"Hello\"}}<\/b>. If you still want to define a completely new template for a culture, use the \"Customize per culture\" button.
To get more information about syntax and other details, please check the Text Templates documentation<\/a>..", + "InlineContentDescription": "This template uses inline localization. You can use the **L** function to localize a text, like **{{L \"Hello\"}}**. If you still want to define a completely new template for a culture, use the \"Customize per culture\" button. \nTo get more information about syntax and other details, please check the [Text Templates documentation](https://docs.abp.io/en/abp/latest/Text-Templating).", "RestoreTemplateToDefault": "Revert to the default template", "RestoreTemplateToDefaultMessage": "Are you sure? This is a built-in template. This operation restores the template to its default properties.", "TemplateUpdated": "Template properties have been updated", diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/Resources/zh-Hans.json b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/Resources/zh-Hans.json index 7f7a8727d..ac4d9acd5 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/Resources/zh-Hans.json +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/Resources/zh-Hans.json @@ -38,7 +38,7 @@ "TemplateContentUpdated": "模板内容已更新", "TemplateContentRestoredToDefault": "模板内容恢复为默认值.", "CustomizePerCulture": "根据文化定制", - "InlineContentDescription": "该模板使用内联本地化. 你可以使用L函数对文本进行本地化,例如 {{L \"Hello\"}}如果你仍想为区域性定义一个全新的模板,请使用\"根据文化定制\"按钮.
请检查
文本模板文档获取更多信息.", + "InlineContentDescription": "该模板使用内联本地化. 你可以使用 **L** 函数对文本进行本地化,例如 **{{L \"Hello\"}}**.如果你仍想为区域性定义一个全新的模板,请使用\"根据文化定制\"按钮. \n请检查 [文本模板文档](https://docs.abp.io/en/abp/latest/Text-Templating) 获取更多信息.", "RestoreTemplateToDefault": "还原到默认模板", "RestoreTemplateToDefaultMessage": "你确定吗? 此模板为内置模板, 此操作将还原模板为默认属性.", "TemplateUpdated": "模板属性已更新", diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookDefinitionAppService.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookDefinitionAppService.cs index 33f1fc5be..a68410ed8 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookDefinitionAppService.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookDefinitionAppService.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Data; +using Volo.Abp.Domain.Entities; namespace LINGYUN.Abp.WebhooksManagement.Definitions; @@ -134,9 +135,18 @@ public class WebhookDefinitionAppService : WebhooksManagementAppServiceBase, IWe { record.IsEnabled = input.IsEnabled; record.ExtraProperties.Clear(); - foreach (var property in input.ExtraProperties) + if (!record.HasSameExtraProperties(input)) { - record.SetProperty(property.Key, property.Value); + var isStatic = record.GetProperty(nameof(WebhookDefinitionDto.IsStatic), true); + + record.ExtraProperties.Clear(); + + foreach (var property in input.ExtraProperties) + { + record.ExtraProperties.Add(property.Key, property.Value); + } + + record.SetProperty(nameof(WebhookDefinitionDto.IsStatic), isStatic); } if (!string.Equals(record.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookGroupDefinitionAppService.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookGroupDefinitionAppService.cs index 3eb1ba6c0..29b5abba6 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookGroupDefinitionAppService.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookGroupDefinitionAppService.cs @@ -100,10 +100,19 @@ public class WebhookGroupDefinitionAppService : WebhooksManagementAppServiceBase CheckIsStaticDefinitionRecord(definitionRecord); - definitionRecord.ExtraProperties.Clear(); - foreach (var property in input.ExtraProperties) + + if (!definitionRecord.HasSameExtraProperties(input)) { - definitionRecord.SetProperty(property.Key, property.Value); + var isStatic = definitionRecord.GetProperty(nameof(WebhookGroupDefinitionDto.IsStatic), true); + + definitionRecord.ExtraProperties.Clear(); + + foreach (var property in input.ExtraProperties) + { + definitionRecord.ExtraProperties.Add(property.Key, property.Value); + } + + definitionRecord.SetProperty(nameof(WebhookGroupDefinitionDto.IsStatic), isStatic); } if (!string.Equals(definitionRecord.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase))