mirror of https://github.com/abpframework/abp.git
21 changed files with 155 additions and 99 deletions
@ -0,0 +1,3 @@ |
|||||
|
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
||||
|
<ConfigureAwait ContinueOnCapturedContext="false" /> |
||||
|
</Weavers> |
||||
@ -0,0 +1,30 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
||||
|
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
||||
|
<xs:element name="Weavers"> |
||||
|
<xs:complexType> |
||||
|
<xs:all> |
||||
|
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1"> |
||||
|
<xs:complexType> |
||||
|
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" /> |
||||
|
</xs:complexType> |
||||
|
</xs:element> |
||||
|
</xs:all> |
||||
|
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
</xs:complexType> |
||||
|
</xs:element> |
||||
|
</xs:schema> |
||||
@ -0,0 +1,17 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
|
<Import Project="..\..\..\configureawait.props" /> |
||||
|
<Import Project="..\..\..\common.props" /> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>net6.0</TargetFramework> |
||||
|
<ImplicitUsings>enable</ImplicitUsings> |
||||
|
<Nullable>enable</Nullable> |
||||
|
<RootNamespace /> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\Volo.Abp.AspNetCore.Dapr\Volo.Abp.AspNetCore.Dapr.csproj" /> |
||||
|
<ProjectReference Include="..\Volo.Abp.EventBus.Dapr\Volo.Abp.EventBus.Dapr.csproj" /> |
||||
|
</ItemGroup> |
||||
|
</Project> |
||||
@ -0,0 +1,31 @@ |
|||||
|
using Microsoft.AspNetCore.Http.Json; |
||||
|
using Volo.Abp.AspNetCore.Dapr.SystemTextJson; |
||||
|
using Volo.Abp.EventBus.Dapr; |
||||
|
using Volo.Abp.Json; |
||||
|
using Volo.Abp.Json.SystemTextJson; |
||||
|
using Volo.Abp.Modularity; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Dapr; |
||||
|
|
||||
|
[DependsOn( |
||||
|
typeof(AbpAspNetCoreDaprModule), |
||||
|
typeof(AbpEventBusDaprModule), |
||||
|
typeof(AbpJsonModule) |
||||
|
)] |
||||
|
public class AbpAspNetCoreDaprEventBusModule : AbpModule |
||||
|
{ |
||||
|
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
|
{ |
||||
|
// TODO: Add NewtonsoftJson json converter.
|
||||
|
|
||||
|
Configure<JsonOptions>(options => |
||||
|
{ |
||||
|
options.SerializerOptions.Converters.Add(new AbpAspNetCoreDaprSubscriptionDefinitionConverter()); |
||||
|
}); |
||||
|
|
||||
|
Configure<AbpSystemTextJsonSerializerOptions>(options => |
||||
|
{ |
||||
|
options.JsonSerializerOptions.Converters.Add(new AbpAspNetCoreDaprSubscriptionDefinitionConverter()); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
namespace Volo.Abp.AspNetCore.Dapr; |
||||
|
|
||||
|
public class AbpAspNetCoreDaprEventBusOptions |
||||
|
{ |
||||
|
public List<IAbpAspNetCoreDaprPubSubProviderContributor> Contributors { get; } |
||||
|
|
||||
|
public AbpAspNetCoreDaprEventBusOptions() |
||||
|
{ |
||||
|
Contributors = new List<IAbpAspNetCoreDaprPubSubProviderContributor>(); |
||||
|
} |
||||
|
} |
||||
@ -1,6 +1,6 @@ |
|||||
namespace Volo.Abp.AspNetCore.Dapr; |
namespace Volo.Abp.AspNetCore.Dapr; |
||||
|
|
||||
public class AbpAspNetCoreDaprConsts |
public class AbpAspNetCoreDaprPubSubConsts |
||||
{ |
{ |
||||
public const string DaprSubscribeUrl = "dapr/subscribe"; |
public const string DaprSubscribeUrl = "dapr/subscribe"; |
||||
|
|
||||
@ -0,0 +1,16 @@ |
|||||
|
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; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
namespace Volo.Abp.AspNetCore.Dapr; |
||||
|
|
||||
|
public interface IAbpAspNetCoreDaprPubSubProviderContributor |
||||
|
{ |
||||
|
Task ContributeAsync(AbpAspNetCoreDaprPubSubProviderContributorContext context); |
||||
|
} |
||||
@ -1,6 +1,6 @@ |
|||||
namespace Volo.Abp.AspNetCore.Dapr.Models; |
namespace Volo.Abp.AspNetCore.Dapr.Models; |
||||
|
|
||||
public class DaprSubscriptionDefinition |
public class AbpAspNetCoreDaprSubscriptionDefinition |
||||
{ |
{ |
||||
public string PubSubName { get; set; } |
public string PubSubName { get; set; } |
||||
|
|
||||
@ -1,6 +1,6 @@ |
|||||
namespace Volo.Abp.AspNetCore.Dapr.Models; |
namespace Volo.Abp.AspNetCore.Dapr.Models; |
||||
|
|
||||
public class DaprSubscriptionRequest |
public class AbpAspNetCoreDaprSubscriptionRequest |
||||
{ |
{ |
||||
public string PubSubName { get; set; } |
public string PubSubName { get; set; } |
||||
|
|
||||
@ -1,31 +1,12 @@ |
|||||
using Microsoft.AspNetCore.Http.Json; |
using Volo.Abp.AspNetCore.Mvc; |
||||
using Volo.Abp.AspNetCore.Dapr.SystemTextJson; |
|
||||
using Volo.Abp.EventBus.Dapr; |
|
||||
using Volo.Abp.Json; |
|
||||
using Volo.Abp.Json.SystemTextJson; |
|
||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
|
|
||||
namespace Volo.Abp.AspNetCore.Dapr; |
namespace Volo.Abp.AspNetCore.Dapr; |
||||
|
|
||||
[DependsOn( |
[DependsOn( |
||||
typeof(AbpAspNetCoreModule), |
typeof(AbpAspNetCoreMvcModule) |
||||
typeof(AbpEventBusDaprModule), |
)] |
||||
typeof(AbpJsonModule) |
|
||||
)] |
|
||||
public class AbpAspNetCoreDaprModule : AbpModule |
public class AbpAspNetCoreDaprModule : AbpModule |
||||
{ |
{ |
||||
public override void ConfigureServices(ServiceConfigurationContext context) |
|
||||
{ |
|
||||
// TODO: Add NewtonsoftJson json converter.
|
|
||||
|
|
||||
Configure<JsonOptions>(options => |
|
||||
{ |
|
||||
options.SerializerOptions.Converters.Add(new DaprSubscriptionDefinitionConverter()); |
|
||||
}); |
|
||||
|
|
||||
Configure<AbpSystemTextJsonSerializerOptions>(options => |
|
||||
{ |
|
||||
options.JsonSerializerOptions.Converters.Add(new DaprSubscriptionDefinitionConverter()); |
|
||||
}); |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,11 +0,0 @@ |
|||||
namespace Volo.Abp.AspNetCore.Dapr; |
|
||||
|
|
||||
public class AbpAspNetCoreDaprOptions |
|
||||
{ |
|
||||
public List<IAbpDaprPubSubProviderContributor> Contributors { get; } |
|
||||
|
|
||||
public AbpAspNetCoreDaprOptions() |
|
||||
{ |
|
||||
Contributors = new List<IAbpDaprPubSubProviderContributor>(); |
|
||||
} |
|
||||
} |
|
||||
@ -1,16 +0,0 @@ |
|||||
using Volo.Abp.AspNetCore.Dapr.Models; |
|
||||
|
|
||||
namespace Volo.Abp.AspNetCore.Dapr; |
|
||||
|
|
||||
public class AbpDaprPubSubProviderContributorContext |
|
||||
{ |
|
||||
public IServiceProvider ServiceProvider { get; } |
|
||||
|
|
||||
public List<DaprSubscriptionDefinition> Subscriptions { get; } |
|
||||
|
|
||||
public AbpDaprPubSubProviderContributorContext(IServiceProvider serviceProvider, List<DaprSubscriptionDefinition> daprSubscriptionModels) |
|
||||
{ |
|
||||
ServiceProvider = serviceProvider; |
|
||||
Subscriptions = daprSubscriptionModels; |
|
||||
} |
|
||||
} |
|
||||
@ -1,6 +0,0 @@ |
|||||
namespace Volo.Abp.AspNetCore.Dapr; |
|
||||
|
|
||||
public interface IAbpDaprPubSubProviderContributor |
|
||||
{ |
|
||||
Task ContributeAsync(AbpDaprPubSubProviderContributorContext context); |
|
||||
} |
|
||||
Loading…
Reference in new issue