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
1.5 KiB
LINGYUN.Abp.WebhooksManagement.Dapr.Client
Webhook管理Dapr客户端集成模块,提供与Dapr服务调用构建块的集成支持。
功能特性
- 支持通过Dapr服务调用访问Webhook管理服务
- 与Dapr服务调用构建块无缝集成
- 支持分布式服务调用
模块引用
[DependsOn(typeof(AbpWebhooksManagementDaprClientModule))]
public class YouProjectModule : AbpModule
{
// other
}
配置项
{
"WebhooksManagement": {
"Dapr": {
"AppId": "webhooks-management", // Webhook管理服务的Dapr应用ID
"HttpEndpoint": "http://localhost:3500" // Dapr sidecar HTTP端点
}
}
}
基本用法
- 配置Dapr客户端
Configure<AbpWebhooksManagementDaprClientOptions>(options =>
{
options.AppId = "webhooks-management";
options.HttpEndpoint = "http://localhost:3500";
});
- 使用Webhook管理客户端
public class YourService
{
private readonly IWebhookSubscriptionAppService _webhookSubscriptionAppService;
public YourService(IWebhookSubscriptionAppService webhookSubscriptionAppService)
{
_webhookSubscriptionAppService = webhookSubscriptionAppService;
}
public async Task SubscribeWebhook()
{
await _webhookSubscriptionAppService.SubscribeAsync(new WebhookSubscriptionCreateDto
{
WebhookUri = "https://your-webhook-endpoint",
Webhooks = new[] { "YourWebhook" }
});
}
}