feat: 完善实体追踪审计日志
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.Domain.Repositories;
|
||||
using Volo.Abp.EventBus;
|
||||
using Yi.Framework.Bbs.Domain.Entities.Forum;
|
||||
using Yi.Framework.Bbs.Domain.Shared.Etos;
|
||||
|
||||
namespace Yi.Framework.Bbs.Domain.EventHandlers
|
||||
{
|
||||
public class SeeDiscussEventHandler : ILocalEventHandler<SeeDiscussEventArgs>, ITransientDependency
|
||||
{
|
||||
private IRepository<DiscussEntity, Guid> _repository;
|
||||
public SeeDiscussEventHandler(IRepository<DiscussEntity, Guid> repository)
|
||||
{
|
||||
_repository = repository;
|
||||
}
|
||||
public async Task HandleEventAsync(SeeDiscussEventArgs eventData)
|
||||
{
|
||||
var entity = await _repository.GetAsync(eventData.DiscussId);
|
||||
if (entity is not null)
|
||||
{
|
||||
entity.SeeNum += 1;
|
||||
await _repository.UpdateAsync(entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user