这是基于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.8 KiB

LINGYUN.Abp.WebhooksManagement.HttpApi.Client

Webhook management HTTP API client module that provides dynamic proxy client for webhook management HTTP API.

简体中文

Features

  • Dynamic API client proxy
  • Automatic HTTP client configuration
  • Support for remote service calls
  • Integration with ABP dynamic C# API client

Module Dependencies

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

Configuration

{
  "RemoteServices": {
    "WebhooksManagement": {
      "BaseUrl": "http://localhost:44315/"  // Base URL for webhook management service
    }
  }
}

Basic Usage

  1. Configure Remote Service
public override void ConfigureServices(ServiceConfigurationContext context)
{
    var configuration = context.Services.GetConfiguration();
    
    Configure<AbpRemoteServiceOptions>(options =>
    {
        options.RemoteServices.Default = new RemoteServiceConfiguration(
            configuration["RemoteServices:WebhooksManagement:BaseUrl"]);
    });
}
  1. Use HTTP Client
public class YourService
{
    private readonly IWebhookSubscriptionAppService _webhookSubscriptionAppService;

    public YourService(IWebhookSubscriptionAppService webhookSubscriptionAppService)
    {
        _webhookSubscriptionAppService = webhookSubscriptionAppService;
    }

    public async Task CallRemoteApi()
    {
        // Create subscription
        await _webhookSubscriptionAppService.CreateAsync(new WebhookSubscriptionCreateDto
        {
            WebhookUri = "https://your-webhook-endpoint",
            Webhooks = new[] { "YourWebhook" }
        });

        // Query subscriptions
        var subscriptions = await _webhookSubscriptionAppService.GetListAsync(
            new WebhookSubscriptionGetListInput());
    }
}