Browse Source

feat: Optimize the definition interface

pull/1565/head
colin 2 weeks ago
parent
commit
25ae6e53b5
  1. 5
      aspnet-core/modules/ai/LINGYUN.Abp.AI.Core/LINGYUN/Abp/AI/Internal/DeepSeekChatClientProvider.cs
  2. 11
      aspnet-core/modules/ai/LINGYUN.Abp.AI.Core/LINGYUN/Abp/AI/Internal/OpenAIChatClientProvider.cs
  3. 2
      aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordDto.cs
  4. 2
      aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordDto.cs
  5. 16
      aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN/Abp/AIManagement/AbpAIManagementApplicationMappers.cs
  6. 7
      aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN/Abp/AIManagement/Tools/AIToolDefinitionAppService.cs
  7. 7
      aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionAppService.cs
  8. 3
      aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Localization/Resources/en.json
  9. 3
      aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Localization/Resources/zh-Hans.json
  10. 15
      aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureDefinitionAppService.cs
  11. 15
      aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureGroupDefinitionAppService.cs
  12. 15
      aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionDefinitionAppService.cs
  13. 14
      aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionGroupDefinitionAppService.cs
  14. 18
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Groups/NotificationGroupDefinitionAppService.cs
  15. 14
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Notifications/NotificationDefinitionAppService.cs
  16. 15
      aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingDefinitionAppService.cs
  17. 2
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/Resources/en.json
  18. 2
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/Resources/zh-Hans.json
  19. 14
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookDefinitionAppService.cs
  20. 15
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookGroupDefinitionAppService.cs

5
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"),
];
}
}

11
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"),
];
}

2
aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordDto.cs

@ -19,6 +19,8 @@ public class AIToolDefinitionRecordDto : ExtensibleAuditedEntityDto<Guid>, IHasC
public bool IsGlobal { get; set; }
public bool IsStatic { get; set; }
public string? StateCheckers { get; set; }
public string ConcurrencyStamp { get; set; } = default!;

2
aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordDto.cs

@ -35,6 +35,8 @@ public class WorkspaceDefinitionRecordDto : ExtensibleAuditedEntityDto<Guid>, IH
public bool IsSystem { get; set; }
public bool IsStatic { get; set; }
public string[]? Tools { get; set; }
public string? StateCheckers { get; set; }

16
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<WorkspaceDefinitionRecord, WorkspaceDefinitionRecordDto>
{
[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<AIToolDefinitionRecord, AIToolDefinitionRecordDto>
{
[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);
}
}

7
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);

7
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);

3
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"
}
}

3
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"
}
}

15
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
{

15
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;

15
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

14
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))
{

18
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<NotificationDefinitionGroupRecord?> FindByNameAsync(string name)

14
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);
}
}

15
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);
}
}

2
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 <b>L<\/b> function to localize a text, like <b>{{L \"Hello\"}}<\/b>. If you still want to define a completely new template for a culture, use the \"Customize per culture\" button. <br /> To get more information about syntax and other details, please check the <a href=\"https://docs.abp.io/en/abp/latest/Text-Templating\" target=\"_blank\">Text Templates documentation<\/a>..",
"InlineContentDescription": "This template uses inline localization. You can use the **L** function to localize a text, like **&#123;&#123;L \"Hello\"&#125;&#125;**. 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",

2
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": "该模板使用内联本地化. 你可以使用<b>L</b>函数对文本进行本地化,例如 <b>{{L \"Hello\"}}</b>如果你仍想为区域性定义一个全新的模板,请使用\"根据文化定制\"按钮. <br />请检查<a href=\"https://docs.abp.io/en/abp/latest/Text-Templating\" target=\"_blank\">文本模板文档</a>获取更多信息.",
"InlineContentDescription": "该模板使用内联本地化. 你可以使用 **L** 函数对文本进行本地化,例如 **&#123;&#123;L \"Hello\"&#125;&#125;**.如果你仍想为区域性定义一个全新的模板,请使用\"根据文化定制\"按钮. \n请检查 [文本模板文档](https://docs.abp.io/en/abp/latest/Text-Templating) 获取更多信息.",
"RestoreTemplateToDefault": "还原到默认模板",
"RestoreTemplateToDefaultMessage": "你确定吗? 此模板为内置模板, 此操作将还原模板为默认属性.",
"TemplateUpdated": "模板属性已更新",

14
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))

15
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))

Loading…
Cancel
Save