mirror of https://github.com/abpframework/abp.git
4 changed files with 50 additions and 1 deletions
@ -0,0 +1,13 @@ |
|||||
|
using System; |
||||
|
using Volo.Abp.EventBus; |
||||
|
|
||||
|
namespace Volo.CmsKit.Blogs |
||||
|
{ |
||||
|
[EventName("CmsKit.Blogs.BlogFeature.Changed")] |
||||
|
public class BlogFeatureChangedEto |
||||
|
{ |
||||
|
public Guid BlogId { get; set; } |
||||
|
public string FeatureName { get; set; } |
||||
|
public bool IsEnabled { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Caching; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.EventBus.Distributed; |
||||
|
|
||||
|
namespace Volo.CmsKit.Blogs |
||||
|
{ |
||||
|
public class BlogFeatureChangedHandler : IDistributedEventHandler<BlogFeatureChangedEto>, ITransientDependency |
||||
|
{ |
||||
|
protected IDistributedCache<BlogFeatureDto> Cache { get; } |
||||
|
|
||||
|
public BlogFeatureChangedHandler(IDistributedCache<BlogFeatureDto> cache) |
||||
|
{ |
||||
|
Cache = cache; |
||||
|
} |
||||
|
|
||||
|
public async Task HandleEventAsync(BlogFeatureChangedEto eventData) |
||||
|
{ |
||||
|
await Cache.RemoveAsync($"{eventData.BlogId}_{eventData.FeatureName}"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue