Add translation service for web api

This commit is contained in:
Maxime Adler
2025-02-17 13:49:01 +01:00
parent 7a87e3457b
commit fc7cce4ce6
13 changed files with 81 additions and 68 deletions

View File

@@ -1,16 +1,13 @@
using ArgosV2.AppInsight.Logging;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Abstractions;
namespace ArgosV2.Server.WebAPI.Controllers;
namespace GameIdeas.WebAPI.Controllers;
[Route("api/[controller]")]
[ApiController]
public class TranslationsController (ITelemetryService telemetryClient) : ControllerBase
[Route("api/[controller]")]
public class TranslationsController (ILogger<TranslationsController> Logger) : ControllerBase
{
[Authorize]
[HttpGet]
[HttpGet]
public async Task<IActionResult> GetTranslations()
{
var dictionary = new Dictionary<string, string>();
@@ -31,7 +28,7 @@ public class TranslationsController (ITelemetryService telemetryClient) : Contro
}
catch(Exception ex)
{
telemetryClient.TrackException<TranslationsController>(ex);
Logger.LogError(ex, "Internal translations error");
}
return Ok(dictionary);