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.

59 lines
1.8 KiB

using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.AuditLogging;
namespace Shentun.Peis.AuditLogs
{
[ApiExplorerSettings(GroupName = "Work")]
[Authorize]
public class AuditLogAppService : ApplicationService
{
private readonly IAuditLogRepository _repository;
public AuditLogAppService(IAuditLogRepository repository)
{
_repository = repository;
}
/// <summary>
/// 日志列表
/// </summary>
/// <param name="sorting"></param>
/// <param name="maxResultCount"></param>
/// <param name="skipCount"></param>
/// <param name="startTime">开始时间</param>
/// <param name="endTime">结束时间</param>
/// <param name="userName">操作用户</param>
/// <returns></returns>
public async Task<List<AuditLog>> GetListAsync(string sorting = null,
int maxResultCount = 50,
int skipCount = 0,
DateTime? startTime = null,
DateTime? endTime = null,
string userName = null
)
{
return await _repository.GetListAsync(sorting, maxResultCount, skipCount, startTime, endTime, null, null, null, userName,
null, null, null, null, null, null, null);
}
/// <summary>
/// 根据ID查询信息
/// </summary>
/// <param name="AuditLogId">日志ID</param>
/// <returns></returns>
public async Task<AuditLog> GetByIdAsync(Guid AuditLogId)
{
return await _repository.GetAsync(AuditLogId);
}
}
}