feat(rbac): 添加操作日志标题模糊搜索

This commit is contained in:
wcg
2026-01-04 11:31:28 +08:00
parent 96503a2f15
commit 9a121af7bd
2 changed files with 2 additions and 0 deletions

View File

@@ -7,5 +7,6 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.OperLog
{
public OperEnum? OperType { get; set; }
public string? OperUser { get; set; }
public string? Title { get; set; }
}
}

View File

@@ -28,6 +28,7 @@ namespace Yi.Framework.Rbac.Application.Services.RecordLog
// input.Sorting = $"{nameof(OperationLogEntity.CreationTime)} Desc";
var entities = await _repository._DbQueryable.WhereIF(!string.IsNullOrEmpty(input.OperUser), x => x.OperUser.Contains(input.OperUser!))
.WhereIF(input.OperType is not null, x => x.OperType == input.OperType)
.WhereIF(!string.IsNullOrEmpty(input.Title), x => x.Title.Contains(input.Title!))
.WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime)
.OrderByDescending(it => it.CreationTime) //降序
.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);