namespace Admin.NET.Core.Service;
///
/// 系统差异日志服务
///
[ApiDescriptionSettings(Order = 330)]
public class SysLogDiffService : IDynamicApiController, ITransient
{
private readonly SqlSugarRepository _sysLogDiffRep;
public SysLogDiffService(SqlSugarRepository sysLogDiffRep)
{
_sysLogDiffRep = sysLogDiffRep;
}
///
/// 获取差异日志分页列表
///
///
[SuppressMonitor]
[DisplayName("获取差异日志分页列表")]
public async Task> Page(PageLogInput input)
{
return await _sysLogDiffRep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.StartTime.ToString()), u => u.CreateTime >= input.StartTime)
.WhereIF(!string.IsNullOrWhiteSpace(input.EndTime.ToString()), u => u.CreateTime <= input.EndTime)
.OrderBy(u => u.CreateTime, OrderByType.Desc)
.ToPagedListAsync(input.Page, input.PageSize);
}
///
/// 清空差异日志
///
///
[ApiDescriptionSettings(Name = "Clear"), HttpPost]
[DisplayName("清空差异日志")]
public async Task Clear()
{
return await _sysLogDiffRep.DeleteAsync(u => u.Id > 0);
}
}