//
namespace SafeCampus.Web.Core;
///
/// 访问日志控制器
///
[ApiDescriptionSettings(Tag = "访问日志")]
[Route("sys/audit/[controller]")]
[SuperAdmin]
public class LogVisitController : BaseController
{
private readonly IVisitLogService _visitLogService;
public LogVisitController(IVisitLogService visitLogService)
{
_visitLogService = visitLogService;
}
///
/// 访问日志分页查询
///
///
///
[HttpGet("page")]
public async Task Page([FromQuery] VisitLogPageInput input)
{
return await _visitLogService.Page(input);
}
///
/// 访问日志周统计折线图
///
///
[HttpGet("lineChartData")]
public async Task LineChartData()
{
return await _visitLogService.StatisticsByDay(7);
}
///
/// 访问日志总览饼图
///
///
[HttpGet("pieChartData")]
public async Task PieChartData()
{
return await _visitLogService.TotalCount();
}
///
/// 清空日志
///
///
///
[HttpPost("delete")]
public async Task Delete([FromBody] VisitLogDeleteInput input)
{
await _visitLogService.Delete(input.Category);
}
}