feat: db操作支持不修改更新审计日志
This commit is contained in:
@@ -24,6 +24,15 @@ namespace Yi.Framework.Bbs.Domain.Entities.Forum
|
||||
PlateId = plateId;
|
||||
}
|
||||
|
||||
public void AddSeeNumber()
|
||||
{
|
||||
this.SeeNum += 1;
|
||||
//设置最小值,不更新
|
||||
this.LastModificationTime = DateTime.MinValue;
|
||||
//设置空值,不更新
|
||||
this.LastModifierId = Guid.Empty;
|
||||
}
|
||||
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public override Guid Id { get; protected set; }
|
||||
public string? Title { get; set; }
|
||||
|
||||
@@ -23,13 +23,9 @@ namespace Yi.Framework.Bbs.Domain.EventHandlers
|
||||
var entity = await _repository.GetAsync(eventData.DiscussId);
|
||||
if (entity is not null)
|
||||
{
|
||||
entity.SeeNum += 1;
|
||||
entity.AddSeeNumber();
|
||||
await _repository.UpdateAsync(entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Yi.Framework.ChatHub.Domain.Managers
|
||||
{
|
||||
if (result.Successful)
|
||||
{
|
||||
yield return result.Choices.FirstOrDefault()?.Message.Content ?? string.Empty;
|
||||
yield return result.Choices.FirstOrDefault()?.Message.Content ?? null;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user