这是基于vue-vben-admin 模板适用于abp Vnext的前端管理项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1.5 KiB

LINGYUN.Abp.Webhooks

Base webhook module that provides basic webhook definitions and functionality.

简体中文

Features

  • Basic webhook definitions
  • Webhook publishing and subscription
  • Webhook event data handling
  • Webhook configuration management

Module Dependencies

[DependsOn(typeof(AbpWebhooksModule))]
public class YouProjectModule : AbpModule
{
  // other
}

Basic Usage

  1. Define a Webhook
public class YourWebhookDefinitionProvider : WebhookDefinitionProvider
{
    public override void Define(IWebhookDefinitionContext context)
    {
        context.Add(
            new WebhookDefinition(
                name: "YourWebhook",
                displayName: L("DisplayName:YourWebhook"),
                description: L("Description:YourWebhook")
            )
        );
    }
}
  1. Publish a Webhook
public class YourService
{
    private readonly IWebhookPublisher _webhookPublisher;

    public YourService(IWebhookPublisher webhookPublisher)
    {
        _webhookPublisher = webhookPublisher;
    }

    public async Task PublishWebhook()
    {
        await _webhookPublisher.PublishAsync(
            webhookName: "YourWebhook",
            data: new { /* webhook data */ }
        );
    }
}
  1. Handle Webhook Events
public class YourWebhookHandler : IWebhookHandler, ITransientDependency
{
    public async Task HandleWebhookAsync(WebhookPayload webhook)
    {
        // Handle webhook event
    }
}