You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.5 KiB
45 lines
1.5 KiB
5 months ago
|
// 大名科技(天津)有限公司版权所有 电话:18020030720 QQ:515096995
|
||
|
//
|
||
|
// 此源代码遵循位于源代码树根目录中的 LICENSE 文件的许可证
|
||
|
|
||
|
namespace Admin.NET.Core.Service;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 系统差异日志服务
|
||
|
/// </summary>
|
||
|
[ApiDescriptionSettings(Order = 330)]
|
||
|
public class SysLogDiffService : IDynamicApiController, ITransient
|
||
|
{
|
||
|
private readonly SqlSugarRepository<SysLogDiff> _sysLogDiffRep;
|
||
|
|
||
|
public SysLogDiffService(SqlSugarRepository<SysLogDiff> sysLogDiffRep)
|
||
|
{
|
||
|
_sysLogDiffRep = sysLogDiffRep;
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 获取差异日志分页列表
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
[SuppressMonitor]
|
||
|
[DisplayName("获取差异日志分页列表")]
|
||
|
public async Task<SqlSugarPagedList<SysLogDiff>> 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);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 清空差异日志
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
[ApiDescriptionSettings(Name = "Clear"), HttpPost]
|
||
|
[DisplayName("清空差异日志")]
|
||
|
public async Task<bool> Clear()
|
||
|
{
|
||
|
return await _sysLogDiffRep.DeleteAsync(u => u.Id > 0);
|
||
|
}
|
||
|
}
|