Files
API/TOOHUCardAPI/Controllers/GameConfigController.cs

34 lines
1.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using TOOHUCardAPI.Data.Services;
using TOOHUCardAPI.DTO;
namespace TOOHUCardAPI.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class GameConfigController : ControllerBase
{
private readonly GameConfigurationService _gameConfigurationService;
private readonly ILogger<GameConfigController> _logger;
public GameConfigController(GameConfigurationService gameConfigurationService, ILogger<GameConfigController> logger)
{
_gameConfigurationService = gameConfigurationService;
_logger = logger;
}
[HttpGet]
public async Task<GameConfigResponse> GetGameConfig()
{
var response = await _gameConfigurationService.GetGameConfiguration();
_logger.LogInformation("Game config fetched");
return response;
}
}
}