From 04a9e5215ab2324fc1ce41d00a0f61511a0d75c0 Mon Sep 17 00:00:00 2001 From: colin Date: Wed, 9 Apr 2025 17:17:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(notifications):=20=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E5=8F=91=E9=80=81=E6=A8=A1=E6=9D=BF=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Notifications/INotificationAppService.cs | 2 +- .../Notifications/NotificationAppService.cs | 2 +- .../NotificationClientProxy.Generated.cs | 21 +++++-- .../notifications-generate-proxy.json | 62 ++++++++++++++++++- .../Notifications/NotificationController.cs | 4 +- 5 files changed, 81 insertions(+), 10 deletions(-) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/INotificationAppService.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/INotificationAppService.cs index 12d789ba0..9df9f93a9 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/INotificationAppService.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/INotificationAppService.cs @@ -13,5 +13,5 @@ public interface INotificationAppService Task SendAsync(NotificationSendDto input); - Task SendAsync(NotificationTemplateSendDto input); + Task SendTemplateAsync(NotificationTemplateSendDto input); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/NotificationAppService.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/NotificationAppService.cs index 12bae4c35..b2e095b70 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/NotificationAppService.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/NotificationAppService.cs @@ -127,7 +127,7 @@ public class NotificationAppService : AbpNotificationsApplicationServiceBase, IN severity: input.Severity); } - public async virtual Task SendAsync(NotificationTemplateSendDto input) + public async virtual Task SendTemplateAsync(NotificationTemplateSendDto input) { var notificationTemplate = new NotificationTemplate( input.Name, diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/NotificationClientProxy.Generated.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/NotificationClientProxy.Generated.cs index 3f240b399..4cffc8466 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/NotificationClientProxy.Generated.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/NotificationClientProxy.Generated.cs @@ -1,8 +1,14 @@ // This file is automatically generated by ABP framework to use MVC Controllers from CSharp +using LINGYUN.Abp.Notifications; +using System; +using System.Collections.Generic; using System.Threading.Tasks; +using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.DependencyInjection; +using Volo.Abp.Http.Client; using Volo.Abp.Http.Client.ClientProxying; +using Volo.Abp.Http.Modeling; // ReSharper disable once CheckNamespace namespace LINGYUN.Abp.Notifications; @@ -19,6 +25,14 @@ public partial class NotificationClientProxy : ClientProxyBase> GetAssignableNotifiersAsync() { return await RequestAsync>(nameof(GetAssignableNotifiersAsync)); @@ -29,11 +43,8 @@ public partial class NotificationClientProxy : ClientProxyBase>(nameof(GetAssignableTemplatesAsync)); } - public virtual async Task SendAsync(NotificationTemplateSendDto input) + public virtual async Task> GetAssignableProvidersAsync() { - await RequestAsync(nameof(SendAsync), new ClientProxyRequestTypeValue - { - { typeof(NotificationTemplateSendDto), input } - }); + return await RequestAsync>(nameof(GetAssignableProvidersAsync)); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/notifications-generate-proxy.json b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/notifications-generate-proxy.json index 842b60e85..8aa26e348 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/notifications-generate-proxy.json +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/notifications-generate-proxy.json @@ -1283,6 +1283,14 @@ "type": "LINGYUN.Abp.Notifications.INotificationAppService", "name": "INotificationAppService", "methods": [ + { + "name": "GetAssignableProvidersAsync", + "parametersOnMethod": [], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.ListResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.ListResultDto" + } + }, { "name": "GetAssignableNotifiersAsync", "parametersOnMethod": [], @@ -1317,7 +1325,7 @@ } }, { - "name": "SendAsync", + "name": "SendTemplateAsync", "parametersOnMethod": [ { "name": "input", @@ -1374,6 +1382,43 @@ "allowAnonymous": false, "implementFrom": "LINGYUN.Abp.Notifications.INotificationAppService" }, + "SendTemplateAsyncByInput": { + "uniqueName": "SendTemplateAsyncByInput", + "name": "SendTemplateAsync", + "httpMethod": "POST", + "url": "api/notifications/send/template", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "LINGYUN.Abp.Notifications.NotificationTemplateSendDto, LINGYUN.Abp.Notifications.Application.Contracts", + "type": "LINGYUN.Abp.Notifications.NotificationTemplateSendDto", + "typeSimple": "LINGYUN.Abp.Notifications.NotificationTemplateSendDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "jsonName": null, + "type": "LINGYUN.Abp.Notifications.NotificationTemplateSendDto", + "typeSimple": "LINGYUN.Abp.Notifications.NotificationTemplateSendDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + }, + "allowAnonymous": false, + "implementFrom": "LINGYUN.Abp.Notifications.INotificationAppService" + }, "GetAssignableNotifiersAsync": { "uniqueName": "GetAssignableNotifiersAsync", "name": "GetAssignableNotifiersAsync", @@ -1403,6 +1448,21 @@ }, "allowAnonymous": false, "implementFrom": "LINGYUN.Abp.Notifications.INotificationAppService" + }, + "GetAssignableProvidersAsync": { + "uniqueName": "GetAssignableProvidersAsync", + "name": "GetAssignableProvidersAsync", + "httpMethod": "GET", + "url": "api/notifications/assignable-providers", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.ListResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.ListResultDto" + }, + "allowAnonymous": false, + "implementFrom": "LINGYUN.Abp.Notifications.INotificationAppService" } } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi/LINGYUN/Abp/Notifications/NotificationController.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi/LINGYUN/Abp/Notifications/NotificationController.cs index e58a9745e..bf5dd07cc 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi/LINGYUN/Abp/Notifications/NotificationController.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi/LINGYUN/Abp/Notifications/NotificationController.cs @@ -33,9 +33,9 @@ public class NotificationController : AbpControllerBase, INotificationAppService [HttpPost] [Route("send/template")] - public virtual Task SendAsync(NotificationTemplateSendDto input) + public virtual Task SendTemplateAsync(NotificationTemplateSendDto input) { - return NotificationAppService.SendAsync(input); + return NotificationAppService.SendTemplateAsync(input); } [HttpGet]