Browse Source

feat: renames interface

pull/532/head
cKey 4 years ago
parent
commit
582979b822
  1. 12
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebHooks.ClientProxies/LINGYUN/Abp/WebHooks/ClientProxies/ClientProxiesWebhookPublisher.cs
  2. 9
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/IWebhookPublishAppService.cs
  3. 2
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/IWebhookSendRecordAppService.cs
  4. 4
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/IWebhookSubscriptionAppService.cs
  5. 9
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/IWebhooksPublishAppService.cs
  6. 2
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookAvailableDto.cs
  7. 2
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookPublishInput.cs
  8. 6
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookPublishAppService.cs
  9. 4
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordAppService.cs
  10. 12
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionAppService.cs
  11. 8
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/LINGYUN/Abp/WebhooksManagement/WebhookPublishController.cs
  12. 6
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordController.cs
  13. 8
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionController.cs

12
aspnet-core/modules/webhooks/LINGYUN.Abp.WebHooks.ClientProxies/LINGYUN/Abp/WebHooks/ClientProxies/ClientProxiesWebhookPublisher.cs

@ -11,17 +11,17 @@ namespace LINGYUN.Abp.Webhooks.ClientProxies;
[Dependency(ReplaceServices = true)] [Dependency(ReplaceServices = true)]
public class ClientProxiesWebhookPublisher : IWebhookPublisher, ITransientDependency public class ClientProxiesWebhookPublisher : IWebhookPublisher, ITransientDependency
{ {
protected IWebhooksPublishAppService PublishAppService { get; } protected IWebhookPublishAppService PublishAppService { get; }
public ClientProxiesWebhookPublisher( public ClientProxiesWebhookPublisher(
IWebhooksPublishAppService publishAppService) IWebhookPublishAppService publishAppService)
{ {
PublishAppService = publishAppService; PublishAppService = publishAppService;
} }
public async virtual Task PublishAsync(string webhookName, object data, bool sendExactSameData = false, WebhookHeader headers = null) public async virtual Task PublishAsync(string webhookName, object data, bool sendExactSameData = false, WebhookHeader headers = null)
{ {
var input = new WebhooksPublishInput var input = new WebhookPublishInput
{ {
WebhookName = webhookName, WebhookName = webhookName,
Data = JsonConvert.SerializeObject(data), Data = JsonConvert.SerializeObject(data),
@ -41,7 +41,7 @@ public class ClientProxiesWebhookPublisher : IWebhookPublisher, ITransientDepend
public async virtual Task PublishAsync(string webhookName, object data, Guid? tenantId, bool sendExactSameData = false, WebhookHeader headers = null) public async virtual Task PublishAsync(string webhookName, object data, Guid? tenantId, bool sendExactSameData = false, WebhookHeader headers = null)
{ {
var input = new WebhooksPublishInput var input = new WebhookPublishInput
{ {
WebhookName = webhookName, WebhookName = webhookName,
Data = JsonConvert.SerializeObject(data), Data = JsonConvert.SerializeObject(data),
@ -65,7 +65,7 @@ public class ClientProxiesWebhookPublisher : IWebhookPublisher, ITransientDepend
public async virtual Task PublishAsync(Guid?[] tenantIds, string webhookName, object data, bool sendExactSameData = false, WebhookHeader headers = null) public async virtual Task PublishAsync(Guid?[] tenantIds, string webhookName, object data, bool sendExactSameData = false, WebhookHeader headers = null)
{ {
var input = new WebhooksPublishInput var input = new WebhookPublishInput
{ {
WebhookName = webhookName, WebhookName = webhookName,
Data = JsonConvert.SerializeObject(data), Data = JsonConvert.SerializeObject(data),
@ -84,7 +84,7 @@ public class ClientProxiesWebhookPublisher : IWebhookPublisher, ITransientDepend
await PublishAsync(input); await PublishAsync(input);
} }
protected virtual async Task PublishAsync(WebhooksPublishInput input) protected virtual async Task PublishAsync(WebhookPublishInput input)
{ {
await PublishAppService.PublishAsync(input); await PublishAppService.PublishAsync(input);
} }

9
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/IWebhookPublishAppService.cs

@ -0,0 +1,9 @@
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
namespace LINGYUN.Abp.WebhooksManagement;
public interface IWebhookPublishAppService : IApplicationService
{
Task PublishAsync(WebhookPublishInput input);
}

2
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/IWebhooksSendRecordAppService.cs → aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/IWebhookSendRecordAppService.cs

@ -5,7 +5,7 @@ using Volo.Abp.Application.Services;
namespace LINGYUN.Abp.WebhooksManagement; namespace LINGYUN.Abp.WebhooksManagement;
public interface IWebhooksSendRecordAppService : IApplicationService public interface IWebhookSendRecordAppService : IApplicationService
{ {
Task<WebhookSendRecordDto> GetAsync(Guid id); Task<WebhookSendRecordDto> GetAsync(Guid id);

4
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/IWebhooksSubscriptionAppService.cs → aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/IWebhookSubscriptionAppService.cs

@ -5,7 +5,7 @@ using Volo.Abp.Application.Services;
namespace LINGYUN.Abp.WebhooksManagement; namespace LINGYUN.Abp.WebhooksManagement;
public interface IWebhooksSubscriptionAppService : public interface IWebhookSubscriptionAppService :
ICrudAppService< ICrudAppService<
WebhookSubscriptionDto, WebhookSubscriptionDto,
Guid, Guid,
@ -13,5 +13,5 @@ public interface IWebhooksSubscriptionAppService :
WebhookSubscriptionCreateInput, WebhookSubscriptionCreateInput,
WebhookSubscriptionUpdateInput> WebhookSubscriptionUpdateInput>
{ {
Task<ListResultDto<WebhooksAvailableDto>> GetAllAvailableWebhooksAsync(); Task<ListResultDto<WebhookAvailableDto>> GetAllAvailableWebhooksAsync();
} }

9
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/IWebhooksPublishAppService.cs

@ -1,9 +0,0 @@
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
namespace LINGYUN.Abp.WebhooksManagement;
public interface IWebhooksPublishAppService : IApplicationService
{
Task PublishAsync(WebhooksPublishInput input);
}

2
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhooksAvailableDto.cs → aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookAvailableDto.cs

@ -1,6 +1,6 @@
namespace LINGYUN.Abp.WebhooksManagement; namespace LINGYUN.Abp.WebhooksManagement;
public class WebhooksAvailableDto public class WebhookAvailableDto
{ {
public string Name { get; set; } public string Name { get; set; }
public string DisplayName { get; set; } public string DisplayName { get; set; }

2
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhooksPublishInput.cs → aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookPublishInput.cs

@ -5,7 +5,7 @@ using Volo.Abp.Validation;
namespace LINGYUN.Abp.WebhooksManagement; namespace LINGYUN.Abp.WebhooksManagement;
public class WebhooksPublishInput public class WebhookPublishInput
{ {
[Required] [Required]
[DynamicStringLength(typeof(WebhookEventRecordConsts), nameof(WebhookEventRecordConsts.MaxWebhookNameLength))] [DynamicStringLength(typeof(WebhookEventRecordConsts), nameof(WebhookEventRecordConsts.MaxWebhookNameLength))]

6
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhooksPublishAppService.cs → aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookPublishAppService.cs

@ -8,16 +8,16 @@ using System.Threading.Tasks;
namespace LINGYUN.Abp.WebhooksManagement; namespace LINGYUN.Abp.WebhooksManagement;
[Authorize(WebhooksManagementPermissions.Publish)] [Authorize(WebhooksManagementPermissions.Publish)]
public class WebhooksPublishAppService : WebhooksManagementAppServiceBase, IWebhooksPublishAppService public class WebhookPublishAppService : WebhooksManagementAppServiceBase, IWebhookPublishAppService
{ {
protected IWebhookPublisher InnerPublisher { get; } protected IWebhookPublisher InnerPublisher { get; }
public WebhooksPublishAppService(IWebhookPublisher innerPublisher) public WebhookPublishAppService(IWebhookPublisher innerPublisher)
{ {
InnerPublisher = innerPublisher; InnerPublisher = innerPublisher;
} }
public async virtual Task PublishAsync(WebhooksPublishInput input) public async virtual Task PublishAsync(WebhookPublishInput input)
{ {
var webhookHeader = new WebhookHeader var webhookHeader = new WebhookHeader
{ {

4
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhooksSendRecordAppService.cs → aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordAppService.cs

@ -11,7 +11,7 @@ using Volo.Abp.BackgroundJobs;
namespace LINGYUN.Abp.WebhooksManagement; namespace LINGYUN.Abp.WebhooksManagement;
[Authorize(WebhooksManagementPermissions.WebhooksSendAttempts.Default)] [Authorize(WebhooksManagementPermissions.WebhooksSendAttempts.Default)]
public class WebhooksSendRecordAppService : WebhooksManagementAppServiceBase, IWebhooksSendRecordAppService public class WebhookSendRecordAppService : WebhooksManagementAppServiceBase, IWebhookSendRecordAppService
{ {
protected IBackgroundJobManager BackgroundJobManager => LazyServiceProvider.LazyGetRequiredService<IBackgroundJobManager>(); protected IBackgroundJobManager BackgroundJobManager => LazyServiceProvider.LazyGetRequiredService<IBackgroundJobManager>();
protected IWebhookEventRecordRepository EventRepository => LazyServiceProvider.LazyGetRequiredService<IWebhookEventRecordRepository>(); protected IWebhookEventRecordRepository EventRepository => LazyServiceProvider.LazyGetRequiredService<IWebhookEventRecordRepository>();
@ -20,7 +20,7 @@ public class WebhooksSendRecordAppService : WebhooksManagementAppServiceBase, IW
protected IWebhookSendRecordRepository RecordRepository { get; } protected IWebhookSendRecordRepository RecordRepository { get; }
public WebhooksSendRecordAppService( public WebhookSendRecordAppService(
IWebhookSendRecordRepository recordRepository) IWebhookSendRecordRepository recordRepository)
{ {
RecordRepository = recordRepository; RecordRepository = recordRepository;

12
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhooksSubscriptionAppService.cs → aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionAppService.cs

@ -13,12 +13,12 @@ using Volo.Abp.Application.Dtos;
namespace LINGYUN.Abp.WebhooksManagement; namespace LINGYUN.Abp.WebhooksManagement;
[Authorize(WebhooksManagementPermissions.WebhookSubscription.Default)] [Authorize(WebhooksManagementPermissions.WebhookSubscription.Default)]
public class WebhooksSubscriptionAppService : WebhooksManagementAppServiceBase, IWebhooksSubscriptionAppService public class WebhookSubscriptionAppService : WebhooksManagementAppServiceBase, IWebhookSubscriptionAppService
{ {
protected IWebhookDefinitionManager WebhookDefinitionManager { get; } protected IWebhookDefinitionManager WebhookDefinitionManager { get; }
protected IWebhookSubscriptionRepository SubscriptionRepository { get; } protected IWebhookSubscriptionRepository SubscriptionRepository { get; }
public WebhooksSubscriptionAppService( public WebhookSubscriptionAppService(
IWebhookDefinitionManager webhookDefinitionManager, IWebhookDefinitionManager webhookDefinitionManager,
IWebhookSubscriptionRepository subscriptionRepository) IWebhookSubscriptionRepository subscriptionRepository)
{ {
@ -103,16 +103,16 @@ public class WebhooksSubscriptionAppService : WebhooksManagementAppServiceBase,
return subscription.ToWebhookSubscriptionDto(); return subscription.ToWebhookSubscriptionDto();
} }
public async virtual Task<ListResultDto<WebhooksAvailableDto>> GetAllAvailableWebhooksAsync() public async virtual Task<ListResultDto<WebhookAvailableDto>> GetAllAvailableWebhooksAsync()
{ {
var webhooks = WebhookDefinitionManager.GetAll(); var webhooks = WebhookDefinitionManager.GetAll();
var definitions = new List<WebhooksAvailableDto>(); var definitions = new List<WebhookAvailableDto>();
foreach (var webhookDefinition in webhooks) foreach (var webhookDefinition in webhooks)
{ {
if (await WebhookDefinitionManager.IsAvailableAsync(CurrentTenant.Id, webhookDefinition.Name)) if (await WebhookDefinitionManager.IsAvailableAsync(CurrentTenant.Id, webhookDefinition.Name))
{ {
definitions.Add(new WebhooksAvailableDto definitions.Add(new WebhookAvailableDto
{ {
Name = webhookDefinition.Name, Name = webhookDefinition.Name,
Description = webhookDefinition.Description?.Localize(StringLocalizerFactory), Description = webhookDefinition.Description?.Localize(StringLocalizerFactory),
@ -121,7 +121,7 @@ public class WebhooksSubscriptionAppService : WebhooksManagementAppServiceBase,
} }
} }
return new ListResultDto<WebhooksAvailableDto>(definitions.OrderBy(d => d.Name).ToList()); return new ListResultDto<WebhookAvailableDto>(definitions.OrderBy(d => d.Name).ToList());
} }
protected async virtual Task CheckSubscribedAsync(WebhookSubscriptionCreateOrUpdateInput input) protected async virtual Task CheckSubscribedAsync(WebhookSubscriptionCreateOrUpdateInput input)

8
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/LINGYUN/Abp/WebhooksManagement/WebhooksPublishController.cs → aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/LINGYUN/Abp/WebhooksManagement/WebhookPublishController.cs

@ -10,17 +10,17 @@ namespace LINGYUN.Abp.WebhooksManagement;
[Area(WebhooksManagementRemoteServiceConsts.ModuleName)] [Area(WebhooksManagementRemoteServiceConsts.ModuleName)]
[Authorize(WebhooksManagementPermissions.Publish)] [Authorize(WebhooksManagementPermissions.Publish)]
[Route("api/webhooks/publish")] [Route("api/webhooks/publish")]
public class WebhooksPublishController : WebhooksManagementControllerBase, IWebhooksPublishAppService public class WebhookPublishController : WebhooksManagementControllerBase, IWebhookPublishAppService
{ {
protected IWebhooksPublishAppService PublishAppService { get; } protected IWebhookPublishAppService PublishAppService { get; }
public WebhooksPublishController(IWebhooksPublishAppService publishAppService) public WebhookPublishController(IWebhookPublishAppService publishAppService)
{ {
PublishAppService = publishAppService; PublishAppService = publishAppService;
} }
[HttpPost] [HttpPost]
public virtual Task PublishAsync(WebhooksPublishInput input) public virtual Task PublishAsync(WebhookPublishInput input)
{ {
return PublishAppService.PublishAsync(input); return PublishAppService.PublishAsync(input);
} }

6
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/LINGYUN/Abp/WebhooksManagement/WebhooksSendRecordController.cs → aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordController.cs

@ -12,11 +12,11 @@ namespace LINGYUN.Abp.WebhooksManagement;
[Area(WebhooksManagementRemoteServiceConsts.ModuleName)] [Area(WebhooksManagementRemoteServiceConsts.ModuleName)]
[Authorize(WebhooksManagementPermissions.WebhooksSendAttempts.Default)] [Authorize(WebhooksManagementPermissions.WebhooksSendAttempts.Default)]
[Route("api/webhooks/send-attempts")] [Route("api/webhooks/send-attempts")]
public class WebhooksSendRecordController : WebhooksManagementControllerBase, IWebhooksSendRecordAppService public class WebhookSendRecordController : WebhooksManagementControllerBase, IWebhookSendRecordAppService
{ {
protected IWebhooksSendRecordAppService SendRecordAppService { get; } protected IWebhookSendRecordAppService SendRecordAppService { get; }
public WebhooksSendRecordController(IWebhooksSendRecordAppService sendRecordAppService) public WebhookSendRecordController(IWebhookSendRecordAppService sendRecordAppService)
{ {
SendRecordAppService = sendRecordAppService; SendRecordAppService = sendRecordAppService;
} }

8
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/LINGYUN/Abp/WebhooksManagement/WebhooksSubscriptionController.cs → aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionController.cs

@ -12,11 +12,11 @@ namespace LINGYUN.Abp.WebhooksManagement;
[Area(WebhooksManagementRemoteServiceConsts.ModuleName)] [Area(WebhooksManagementRemoteServiceConsts.ModuleName)]
[Authorize(WebhooksManagementPermissions.WebhookSubscription.Default)] [Authorize(WebhooksManagementPermissions.WebhookSubscription.Default)]
[Route("api/webhooks/subscriptions")] [Route("api/webhooks/subscriptions")]
public class WebhooksSubscriptionController : WebhooksManagementControllerBase, IWebhooksSubscriptionAppService public class WebhookSubscriptionController : WebhooksManagementControllerBase, IWebhookSubscriptionAppService
{ {
protected IWebhooksSubscriptionAppService SubscriptionAppService { get; } protected IWebhookSubscriptionAppService SubscriptionAppService { get; }
public WebhooksSubscriptionController(IWebhooksSubscriptionAppService subscriptionAppService) public WebhookSubscriptionController(IWebhookSubscriptionAppService subscriptionAppService)
{ {
SubscriptionAppService = subscriptionAppService; SubscriptionAppService = subscriptionAppService;
} }
@ -59,7 +59,7 @@ public class WebhooksSubscriptionController : WebhooksManagementControllerBase,
[HttpGet] [HttpGet]
[Route("availables")] [Route("availables")]
public Task<ListResultDto<WebhooksAvailableDto>> GetAllAvailableWebhooksAsync() public Task<ListResultDto<WebhookAvailableDto>> GetAllAvailableWebhooksAsync()
{ {
return SubscriptionAppService.GetAllAvailableWebhooksAsync(); return SubscriptionAppService.GetAllAvailableWebhooksAsync();
} }
Loading…
Cancel
Save