mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-11 23:58:08 -05:00
huge commit for advanced stats feature.
broke data out into its own library. may be breaking changes with existing plugins
This commit is contained in:
@ -0,0 +1,38 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SharedLibraryCore;
|
||||
using SharedLibraryCore.Configuration;
|
||||
using SharedLibraryCore.Interfaces;
|
||||
using Stats.Dtos;
|
||||
|
||||
namespace WebfrontCore.Controllers
|
||||
{
|
||||
[Route("clientstatistics")]
|
||||
public class ClientStatisticsController : BaseController
|
||||
{
|
||||
private IResourceQueryHelper<StatsInfoRequest, AdvancedStatsInfo> _queryHelper;
|
||||
private readonly DefaultSettings _defaultConfig;
|
||||
|
||||
public ClientStatisticsController(IManager manager,
|
||||
IResourceQueryHelper<StatsInfoRequest, AdvancedStatsInfo> queryHelper,
|
||||
IConfigurationHandler<DefaultSettings> configurationHandler) : base(manager)
|
||||
{
|
||||
_queryHelper = queryHelper;
|
||||
_defaultConfig = configurationHandler.Configuration();
|
||||
}
|
||||
|
||||
[HttpGet("{id:int}/advanced")]
|
||||
public async Task<IActionResult> Advanced(int id, [FromQuery] string serverId)
|
||||
{
|
||||
ViewBag.Config = _defaultConfig.GameStrings;
|
||||
var hitInfo = await _queryHelper.QueryResource(new StatsInfoRequest
|
||||
{
|
||||
ClientId = id,
|
||||
ServerEndpoint = serverId
|
||||
});
|
||||
|
||||
return View("~/Views/Client/Statistics/Advanced.cshtml", hitInfo.Results.First());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user