mirror of https://github.com/abpframework/abp.git
28 changed files with 133 additions and 134 deletions
@ -1,11 +0,0 @@ |
|||||
namespace Volo.Abp.AspNetCore.Dapr; |
|
||||
|
|
||||
public class AbpAspNetCoreDaprEventBusOptions |
|
||||
{ |
|
||||
public List<IAbpAspNetCoreDaprPubSubProviderContributor> Contributors { get; } |
|
||||
|
|
||||
public AbpAspNetCoreDaprEventBusOptions() |
|
||||
{ |
|
||||
Contributors = new List<IAbpAspNetCoreDaprPubSubProviderContributor>(); |
|
||||
} |
|
||||
} |
|
||||
@ -1,16 +0,0 @@ |
|||||
using Volo.Abp.AspNetCore.Dapr.Models; |
|
||||
|
|
||||
namespace Volo.Abp.AspNetCore.Dapr; |
|
||||
|
|
||||
public class AbpAspNetCoreDaprPubSubProviderContributorContext |
|
||||
{ |
|
||||
public IServiceProvider ServiceProvider { get; } |
|
||||
|
|
||||
public List<AbpAspNetCoreDaprSubscriptionDefinition> Subscriptions { get; } |
|
||||
|
|
||||
public AbpAspNetCoreDaprPubSubProviderContributorContext(IServiceProvider serviceProvider, List<AbpAspNetCoreDaprSubscriptionDefinition> daprSubscriptionModels) |
|
||||
{ |
|
||||
ServiceProvider = serviceProvider; |
|
||||
Subscriptions = daprSubscriptionModels; |
|
||||
} |
|
||||
} |
|
||||
@ -1,6 +0,0 @@ |
|||||
namespace Volo.Abp.AspNetCore.Dapr; |
|
||||
|
|
||||
public interface IAbpAspNetCoreDaprPubSubProviderContributor |
|
||||
{ |
|
||||
Task ContributeAsync(AbpAspNetCoreDaprPubSubProviderContributorContext context); |
|
||||
} |
|
||||
@ -1,8 +0,0 @@ |
|||||
namespace Volo.Abp.AspNetCore.Dapr.Models; |
|
||||
|
|
||||
public class AbpAspNetCoreDaprSubscriptionRequest |
|
||||
{ |
|
||||
public string PubSubName { get; set; } |
|
||||
|
|
||||
public string Topic { get; set; } |
|
||||
} |
|
||||
@ -1,11 +0,0 @@ |
|||||
using System.Text.Json; |
|
||||
|
|
||||
namespace Volo.Abp.AspNetCore.Dapr.SystemTextJson; |
|
||||
|
|
||||
public class AbpAspNetCoreDaprPubSubJsonNamingPolicy : JsonNamingPolicy |
|
||||
{ |
|
||||
public override string ConvertName(string name) |
|
||||
{ |
|
||||
return name.ToLower(); |
|
||||
} |
|
||||
} |
|
||||
@ -1,25 +0,0 @@ |
|||||
using System.Text.Json; |
|
||||
using System.Text.Json.Serialization; |
|
||||
using Volo.Abp.AspNetCore.Dapr.Models; |
|
||||
|
|
||||
namespace Volo.Abp.AspNetCore.Dapr.SystemTextJson; |
|
||||
|
|
||||
public class AbpAspNetCoreDaprSubscriptionDefinitionConverter : JsonConverter<AbpAspNetCoreDaprSubscriptionDefinition> |
|
||||
{ |
|
||||
private JsonSerializerOptions _writeJsonSerializerOptions; |
|
||||
|
|
||||
public override AbpAspNetCoreDaprSubscriptionDefinition Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) |
|
||||
{ |
|
||||
throw new NotSupportedException(); |
|
||||
} |
|
||||
|
|
||||
public override void Write(Utf8JsonWriter writer, AbpAspNetCoreDaprSubscriptionDefinition value, JsonSerializerOptions options) |
|
||||
{ |
|
||||
_writeJsonSerializerOptions ??= JsonSerializerOptionsHelper.Create(new JsonSerializerOptions(options) |
|
||||
{ |
|
||||
PropertyNamingPolicy = new AbpAspNetCoreDaprPubSubJsonNamingPolicy() |
|
||||
}, x => x == this); |
|
||||
|
|
||||
JsonSerializer.Serialize(writer, value, _writeJsonSerializerOptions); |
|
||||
} |
|
||||
} |
|
||||
@ -1,12 +0,0 @@ |
|||||
using Volo.Abp.AspNetCore.Mvc; |
|
||||
using Volo.Abp.Modularity; |
|
||||
|
|
||||
namespace Volo.Abp.AspNetCore.Dapr; |
|
||||
|
|
||||
[DependsOn( |
|
||||
typeof(AbpAspNetCoreMvcModule) |
|
||||
)] |
|
||||
public class AbpAspNetCoreDaprModule : AbpModule |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
@ -0,0 +1,11 @@ |
|||||
|
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus; |
||||
|
|
||||
|
public class AbpAspNetCoreMvcDaprEventBusOptions |
||||
|
{ |
||||
|
public List<IAbpAspNetCoreMvcDaprPubSubProviderContributor> Contributors { get; } |
||||
|
|
||||
|
public AbpAspNetCoreMvcDaprEventBusOptions() |
||||
|
{ |
||||
|
Contributors = new List<IAbpAspNetCoreMvcDaprPubSubProviderContributor>(); |
||||
|
} |
||||
|
} |
||||
@ -1,6 +1,6 @@ |
|||||
namespace Volo.Abp.AspNetCore.Dapr; |
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus; |
||||
|
|
||||
public class AbpAspNetCoreDaprPubSubConsts |
public class AbpAspNetCoreMvcDaprPubSubConsts |
||||
{ |
{ |
||||
public const string DaprSubscribeUrl = "dapr/subscribe"; |
public const string DaprSubscribeUrl = "dapr/subscribe"; |
||||
|
|
||||
@ -0,0 +1,16 @@ |
|||||
|
using Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus; |
||||
|
|
||||
|
public class AbpAspNetCoreMvcDaprPubSubProviderContributorContext |
||||
|
{ |
||||
|
public IServiceProvider ServiceProvider { get; } |
||||
|
|
||||
|
public List<AbpAspNetCoreMvcDaprSubscriptionDefinition> Subscriptions { get; } |
||||
|
|
||||
|
public AbpAspNetCoreMvcDaprPubSubProviderContributorContext(IServiceProvider serviceProvider, List<AbpAspNetCoreMvcDaprSubscriptionDefinition> daprSubscriptionModels) |
||||
|
{ |
||||
|
ServiceProvider = serviceProvider; |
||||
|
Subscriptions = daprSubscriptionModels; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus; |
||||
|
|
||||
|
public interface IAbpAspNetCoreMvcDaprPubSubProviderContributor |
||||
|
{ |
||||
|
Task ContributeAsync(AbpAspNetCoreMvcDaprPubSubProviderContributorContext context); |
||||
|
} |
||||
@ -1,6 +1,6 @@ |
|||||
namespace Volo.Abp.AspNetCore.Dapr.Models; |
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; |
||||
|
|
||||
public class AbpAspNetCoreDaprSubscriptionDefinition |
public class AbpAspNetCoreMvcDaprSubscriptionDefinition |
||||
{ |
{ |
||||
public string PubSubName { get; set; } |
public string PubSubName { get; set; } |
||||
|
|
||||
@ -0,0 +1,8 @@ |
|||||
|
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; |
||||
|
|
||||
|
public class AbpAspNetCoreMvcDaprSubscriptionRequest |
||||
|
{ |
||||
|
public string PubSubName { get; set; } |
||||
|
|
||||
|
public string Topic { get; set; } |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
using System.Text.Json; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.SystemTextJson; |
||||
|
|
||||
|
public class AbpAspNetCoreMvcDaprPubSubJsonNamingPolicy : JsonNamingPolicy |
||||
|
{ |
||||
|
public override string ConvertName(string name) |
||||
|
{ |
||||
|
return name.ToLower(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
using System.Text.Json; |
||||
|
using System.Text.Json.Serialization; |
||||
|
using Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.SystemTextJson; |
||||
|
|
||||
|
public class AbpAspNetCoreMvcDaprSubscriptionDefinitionConverter : JsonConverter<AbpAspNetCoreMvcDaprSubscriptionDefinition> |
||||
|
{ |
||||
|
private JsonSerializerOptions _writeJsonSerializerOptions; |
||||
|
|
||||
|
public override AbpAspNetCoreMvcDaprSubscriptionDefinition Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) |
||||
|
{ |
||||
|
throw new NotSupportedException(); |
||||
|
} |
||||
|
|
||||
|
public override void Write(Utf8JsonWriter writer, AbpAspNetCoreMvcDaprSubscriptionDefinition value, JsonSerializerOptions options) |
||||
|
{ |
||||
|
_writeJsonSerializerOptions ??= JsonSerializerOptionsHelper.Create(new JsonSerializerOptions(options) |
||||
|
{ |
||||
|
PropertyNamingPolicy = new AbpAspNetCoreMvcDaprPubSubJsonNamingPolicy() |
||||
|
}, x => x == this); |
||||
|
|
||||
|
JsonSerializer.Serialize(writer, value, _writeJsonSerializerOptions); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
using Volo.Abp.Dapr; |
||||
|
using Volo.Abp.Modularity; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.Dapr; |
||||
|
|
||||
|
[DependsOn( |
||||
|
typeof(AbpAspNetCoreMvcModule), |
||||
|
typeof(AbpDaprModule) |
||||
|
)] |
||||
|
public class AbpAspNetCoreMvcDaprModule : AbpModule |
||||
|
{ |
||||
|
|
||||
|
} |
||||
Loading…
Reference in new issue