29 changed files with 2035 additions and 13 deletions
@ -0,0 +1,60 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Abp.Notifications.Definitions.Groups; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Abp.Notifications.Definitions.Groups; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(INotificationGroupDefinitionAppService), typeof(NotificationGroupDefinitionClientProxy))] |
|||
public partial class NotificationGroupDefinitionClientProxy : ClientProxyBase<INotificationGroupDefinitionAppService>, INotificationGroupDefinitionAppService |
|||
{ |
|||
public virtual async Task<NotificationGroupDefinitionDto> CreateAsync(NotificationGroupDefinitionCreateDto input) |
|||
{ |
|||
return await RequestAsync<NotificationGroupDefinitionDto>(nameof(CreateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(NotificationGroupDefinitionCreateDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task DeleteAsync(string name) |
|||
{ |
|||
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(string), name } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<NotificationGroupDefinitionDto> GetAsync(string name) |
|||
{ |
|||
return await RequestAsync<NotificationGroupDefinitionDto>(nameof(GetAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(string), name } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<ListResultDto<NotificationGroupDefinitionDto>> GetListAsync(NotificationGroupDefinitionGetListInput input) |
|||
{ |
|||
return await RequestAsync<ListResultDto<NotificationGroupDefinitionDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(NotificationGroupDefinitionGetListInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<NotificationGroupDefinitionDto> UpdateAsync(string name, NotificationGroupDefinitionUpdateDto input) |
|||
{ |
|||
return await RequestAsync<NotificationGroupDefinitionDto>(nameof(UpdateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(string), name }, |
|||
{ typeof(NotificationGroupDefinitionUpdateDto), input } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of NotificationGroupDefinitionClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Abp.Notifications.Definitions.Groups; |
|||
|
|||
public partial class NotificationGroupDefinitionClientProxy |
|||
{ |
|||
} |
|||
@ -0,0 +1,60 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Abp.Notifications.Definitions.Notifications; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Abp.Notifications.Definitions.Notifications; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(INotificationDefinitionAppService), typeof(NotificationDefinitionClientProxy))] |
|||
public partial class NotificationDefinitionClientProxy : ClientProxyBase<INotificationDefinitionAppService>, INotificationDefinitionAppService |
|||
{ |
|||
public virtual async Task<NotificationDefinitionDto> CreateAsync(NotificationDefinitionCreateDto input) |
|||
{ |
|||
return await RequestAsync<NotificationDefinitionDto>(nameof(CreateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(NotificationDefinitionCreateDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task DeleteAsync(string name) |
|||
{ |
|||
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(string), name } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<NotificationDefinitionDto> GetAsync(string name) |
|||
{ |
|||
return await RequestAsync<NotificationDefinitionDto>(nameof(GetAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(string), name } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<ListResultDto<NotificationDefinitionDto>> GetListAsync(NotificationDefinitionGetListInput input) |
|||
{ |
|||
return await RequestAsync<ListResultDto<NotificationDefinitionDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(NotificationDefinitionGetListInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<NotificationDefinitionDto> UpdateAsync(string name, NotificationDefinitionUpdateDto input) |
|||
{ |
|||
return await RequestAsync<NotificationDefinitionDto>(nameof(UpdateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(string), name }, |
|||
{ typeof(NotificationDefinitionUpdateDto), input } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of NotificationDefinitionClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Abp.Notifications.Definitions.Notifications; |
|||
|
|||
public partial class NotificationDefinitionClientProxy |
|||
{ |
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Abp.Notifications; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Abp.Notifications; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(IMyNotificationAppService), typeof(MyNotificationClientProxy))] |
|||
public partial class MyNotificationClientProxy : ClientProxyBase<IMyNotificationAppService>, IMyNotificationAppService |
|||
{ |
|||
public virtual async Task MarkReadStateAsync(NotificationMarkReadStateInput input) |
|||
{ |
|||
await RequestAsync(nameof(MarkReadStateAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(NotificationMarkReadStateInput), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task DeleteAsync(long id) |
|||
{ |
|||
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(long), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<UserNotificationDto> GetAsync(long id) |
|||
{ |
|||
return await RequestAsync<UserNotificationDto>(nameof(GetAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(long), id } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<PagedResultDto<UserNotificationDto>> GetListAsync(UserNotificationGetByPagedDto input) |
|||
{ |
|||
return await RequestAsync<PagedResultDto<UserNotificationDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(UserNotificationGetByPagedDto), input } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of MyNotificationClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Abp.Notifications; |
|||
|
|||
public partial class MyNotificationClientProxy |
|||
{ |
|||
} |
|||
@ -0,0 +1,56 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using LINGYUN.Abp.Notifications; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.Abp.Http.Modeling; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Abp.Notifications; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(IMySubscriptionAppService), typeof(MySubscriptionClientProxy))] |
|||
public partial class MySubscriptionClientProxy : ClientProxyBase<IMySubscriptionAppService>, IMySubscriptionAppService |
|||
{ |
|||
public virtual async Task<ListResultDto<UserSubscreNotificationDto>> GetAllListAsync() |
|||
{ |
|||
return await RequestAsync<ListResultDto<UserSubscreNotificationDto>>(nameof(GetAllListAsync)); |
|||
} |
|||
|
|||
public virtual async Task<PagedResultDto<UserSubscreNotificationDto>> GetListAsync(SubscriptionsGetByPagedDto input) |
|||
{ |
|||
return await RequestAsync<PagedResultDto<UserSubscreNotificationDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(SubscriptionsGetByPagedDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<UserSubscriptionsResult> IsSubscribedAsync(SubscriptionsGetByNameDto input) |
|||
{ |
|||
return await RequestAsync<UserSubscriptionsResult>(nameof(IsSubscribedAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(SubscriptionsGetByNameDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task SubscribeAsync(SubscriptionsGetByNameDto input) |
|||
{ |
|||
await RequestAsync(nameof(SubscribeAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(SubscriptionsGetByNameDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task UnSubscribeAsync(SubscriptionsGetByNameDto input) |
|||
{ |
|||
await RequestAsync(nameof(UnSubscribeAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(SubscriptionsGetByNameDto), input } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of MySubscriptionClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Abp.Notifications; |
|||
|
|||
public partial class MySubscriptionClientProxy |
|||
{ |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Abp.Notifications; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(INotificationAppService), typeof(NotificationClientProxy))] |
|||
public partial class NotificationClientProxy : ClientProxyBase<INotificationAppService>, INotificationAppService |
|||
{ |
|||
public virtual async Task SendAsync(NotificationSendDto input) |
|||
{ |
|||
await RequestAsync(nameof(SendAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(NotificationSendDto), input } |
|||
}); |
|||
} |
|||
|
|||
public virtual async Task<ListResultDto<NotificationGroupDto>> GetAssignableNotifiersAsync() |
|||
{ |
|||
return await RequestAsync<ListResultDto<NotificationGroupDto>>(nameof(GetAssignableNotifiersAsync)); |
|||
} |
|||
|
|||
public virtual async Task<ListResultDto<NotificationTemplateDto>> GetAssignableTemplatesAsync() |
|||
{ |
|||
return await RequestAsync<ListResultDto<NotificationTemplateDto>>(nameof(GetAssignableTemplatesAsync)); |
|||
} |
|||
|
|||
public virtual async Task SendAsync(NotificationTemplateSendDto input) |
|||
{ |
|||
await RequestAsync(nameof(SendAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(NotificationTemplateSendDto), input } |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
// This file is part of NotificationClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace LINGYUN.Abp.Notifications; |
|||
|
|||
public partial class NotificationClientProxy |
|||
{ |
|||
} |
|||
File diff suppressed because it is too large
@ -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,23 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<EmbeddedResource Include="ClientProxies\notifications-generate-proxy.json" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.Http.Client" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\LINGYUN.Abp.Notifications.Application.Contracts\LINGYUN.Abp.Notifications.Application.Contracts.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,19 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace LINGYUN.Abp.Notifications; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpHttpClientModule), |
|||
typeof(AbpNotificationsApplicationContractsModule))] |
|||
public class AbpNotificationsHttpApiClientModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddStaticHttpClientProxies( |
|||
typeof(AbpNotificationsApplicationContractsModule).Assembly, |
|||
AbpNotificationsRemoteServiceConsts.RemoteServiceName |
|||
); |
|||
} |
|||
} |
|||
@ -0,0 +1,112 @@ |
|||
|
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace LY.MicroService.Applications.Single; |
|||
|
|||
[Dependency(ServiceLifetime.Singleton, ReplaceServices = true)] |
|||
public class AbpDynamicFeatureDefinitionStoreInMemoryCache : IDynamicFeatureDefinitionStoreInMemoryCache |
|||
{ |
|||
public string CacheStamp { get; set; } |
|||
|
|||
protected IDictionary<string, FeatureGroupDefinition> FeatureGroupDefinitions { get; } |
|||
protected IDictionary<string, FeatureDefinition> FeatureDefinitions { get; } |
|||
protected StringValueTypeSerializer StateCheckerSerializer { get; } |
|||
protected ILocalizableStringSerializer LocalizableStringSerializer { get; } |
|||
|
|||
public SemaphoreSlim SyncSemaphore { get; } = new(1, 1); |
|||
|
|||
public DateTime? LastCheckTime { get; set; } |
|||
|
|||
public AbpDynamicFeatureDefinitionStoreInMemoryCache( |
|||
StringValueTypeSerializer stateCheckerSerializer, |
|||
ILocalizableStringSerializer localizableStringSerializer) |
|||
{ |
|||
StateCheckerSerializer = stateCheckerSerializer; |
|||
LocalizableStringSerializer = localizableStringSerializer; |
|||
|
|||
FeatureGroupDefinitions = new Dictionary<string, FeatureGroupDefinition>(); |
|||
FeatureDefinitions = new Dictionary<string, FeatureDefinition>(); |
|||
} |
|||
|
|||
public Task FillAsync( |
|||
List<FeatureGroupDefinitionRecord> featureGroupRecords, |
|||
List<FeatureDefinitionRecord> featureRecords) |
|||
{ |
|||
FeatureGroupDefinitions.Clear(); |
|||
FeatureDefinitions.Clear(); |
|||
|
|||
var context = new FeatureDefinitionContext(); |
|||
|
|||
foreach (var featureGroupRecord in featureGroupRecords) |
|||
{ |
|||
var featureGroup = context.AddGroup( |
|||
featureGroupRecord.Name, |
|||
featureGroupRecord.DisplayName != null ? LocalizableStringSerializer.Deserialize(featureGroupRecord.DisplayName) : null |
|||
); |
|||
|
|||
FeatureGroupDefinitions[featureGroup.Name] = featureGroup; |
|||
|
|||
foreach (var property in featureGroupRecord.ExtraProperties) |
|||
{ |
|||
featureGroup[property.Key] = property.Value; |
|||
} |
|||
|
|||
var featureRecordsInThisGroup = featureRecords |
|||
.Where(p => p.GroupName == featureGroup.Name); |
|||
|
|||
foreach (var featureRecord in featureRecordsInThisGroup.Where(x => x.ParentName == null)) |
|||
{ |
|||
AddFeatureRecursively(featureGroup, featureRecord, featureRecords); |
|||
} |
|||
} |
|||
|
|||
return Task.CompletedTask; |
|||
} |
|||
|
|||
public FeatureDefinition GetFeatureOrNull(string name) |
|||
{ |
|||
return FeatureDefinitions.GetOrDefault(name); |
|||
} |
|||
|
|||
public IReadOnlyList<FeatureDefinition> GetFeatures() |
|||
{ |
|||
return FeatureDefinitions.Values.ToList(); |
|||
} |
|||
|
|||
public IReadOnlyList<FeatureGroupDefinition> GetGroups() |
|||
{ |
|||
return FeatureGroupDefinitions.Values.ToList(); |
|||
} |
|||
|
|||
private void AddFeatureRecursively(ICanCreateChildFeature featureContainer, |
|||
FeatureDefinitionRecord featureRecord, |
|||
List<FeatureDefinitionRecord> allFeatureRecords) |
|||
{ |
|||
var feature = featureContainer.CreateChildFeature( |
|||
featureRecord.Name, |
|||
featureRecord.DefaultValue, |
|||
featureRecord.DisplayName != null ? LocalizableStringSerializer.Deserialize(featureRecord.DisplayName) : null, |
|||
featureRecord.Description != null ? LocalizableStringSerializer.Deserialize(featureRecord.Description) : null, |
|||
StateCheckerSerializer.Deserialize(featureRecord.ValueType), |
|||
featureRecord.IsVisibleToClients, |
|||
featureRecord.IsAvailableToHost |
|||
); |
|||
|
|||
FeatureDefinitions[feature.Name] = feature; |
|||
|
|||
if (!featureRecord.AllowedProviders.IsNullOrWhiteSpace()) |
|||
{ |
|||
feature.AllowedProviders.AddRange(featureRecord.AllowedProviders.Split(',')); |
|||
} |
|||
|
|||
foreach (var property in featureRecord.ExtraProperties) |
|||
{ |
|||
feature[property.Key] = property.Value; |
|||
} |
|||
|
|||
foreach (var subFeature in allFeatureRecords.Where(p => p.ParentName == featureRecord.Name)) |
|||
{ |
|||
AddFeatureRecursively(feature, subFeature, allFeatureRecords); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue