feat(rbac): 添加操作日志标题模糊搜索
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user