36 lines
936 B
C#
36 lines
936 B
C#
using BITKit;
|
|
using IDIS;
|
|
using IDIS_Server_SIM.Extensions;
|
|
using IDIS.Models;
|
|
using IDIS.Services;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace IDIS_Server_SIM.Controllers;
|
|
|
|
[ApiController]
|
|
public class IDIS_StatisticsController:Controller
|
|
{
|
|
private readonly IDIS_Statistics_MySQLBased _service;
|
|
private readonly ILogger<IDIS_StatisticsController> _logger;
|
|
public IDIS_StatisticsController(IDIS_Statistics_MySQLBased service, ILogger<IDIS_StatisticsController> logger)
|
|
{
|
|
_service = service;
|
|
_logger = logger;
|
|
}
|
|
|
|
[Route("/api/query/today")]
|
|
public async Task<IActionResult> GetTodayQuery()
|
|
{
|
|
var result = await _service.GetTodayQuery();
|
|
|
|
return new IDIS_Response(result).ToActionResult();
|
|
}
|
|
[Route("/api/query/count")]
|
|
public async Task<IActionResult> GetQueryCount(string handle)
|
|
{
|
|
var result = await _service.GetQueryCount(handle);
|
|
|
|
return new IDIS_Response(result).ToActionResult();
|
|
}
|
|
} |